Answer Posted / hazarath k
Yes Callable is an interface. Actually 3 ineterfaces are
provided in java for retreiving the data from DB.Those are:
1.Statement
2.PreparedStatement
3.Callable Statement
Every vendor provide their own implementations for these
interfaces.
If we use Statement object, then the SQL query is parsed
and executed each and every time when the request comes.
If the SQL statement is same but with different values <--
in this scenario no need of parsing each time,only
execution is needed, because same statement is sending to
the server several times but with different values.In this
scenario it is better to parse the statement for first time
only, later onwards it is better to send only values. So in
this situations, it is better to go for
PreparedStatement.It increases the speed also.
If you are planing to call the stored procedures from front
end, then it is better to use Callable statement.
EX(syntax):
Connection con=DriverManager.getConnection("----
","userID","pwd"):
CallableStatement cstmt=con.prepareCall('{call
procedureName}');
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
How a database driver can be loaded with jdbc 4.0 / java 6?
What is jdbc driver for sql server?
What is jndi lookup?
What are the differences between setmaxrows(int) and setfetchsize(int)?
Is oracle client required for jdbc connection?
What does jdbc stand for?
Discuss the procedure of retrieving warnings?
How do you insert images into database using jdbc?
Is jdbc a framework?
How can we retrieve data from the resultset?
What is odbc jdbc?
What is jdbc connection?
How do I insert an image file (or other raw data) into a database?
Why do I have to reaccess the database for Array, Blob, and Clob data?
Define preparedstatement.