What is actual difference between statement,prepared
statement and callable statement and when we have to use it?
pls post a answer with code and clear explanation. thanks
Answers were Sorted based on User's Feedback
Answer / aravind
When you use normal statements compilation of statement or
parsing of statement will happen everytime. This is time
cosuming when u have mutliple queries to execute.
Statemtn s = conn.createStatement();
In prepared statement SQL query will be compiled or parsed
for the very first time and kept in some kind of pool. When
u execute one more time the same statement with different
values it saves the parsing time.
SQL select * from employee where employeeID=?,empName=?;
PreparedStatement ps = conn.PreparedStatement();
Callable statements are used to execute stored procedures
similar to java functions.
|Is This Answer Correct ?||44 Yes||5 No|
Answer / sudha
Prepared statement is precompiled statement it is used when
we want one query to be executed n no. of times.
whereas callablestatement is used to call stored procedures
|Is This Answer Correct ?||41 Yes||3 No|
What classes of exceptions may be caught by a catch clause in java programming?
Can you call a private data from an inner class?
What is java objectoutputstream?
In java, how many ways you can take input from the console?
What is the difference between keyword and identifier?
What is difference between this and super keyword?
What is the concept of multithreading?
What are memory tables?
What is the r character?
what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0
what is the purpose of class "Object" which is base class for all classes?
Is static variable stored in heap?