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
What do you mean by metadata and why we are using it?
How are jdbc statements used?
What is jdbc connection interface?
Explain the difference between inner and outer join ?
What is an advantage of using the jdbc connection pool?
Explain the necessary steps to connect to the database in java?
How do we call a stored procedure from jdbc?
Which package contains jdbc api?
What is “dirty read” in JDBC? Which isolation level prevents dirty read?
What is metadata in jdbc?
What types of DataSource objects are specified in the Optional Package?
How can I create a custom RowSetMetaData object from scratch?
What is difference between jdbc and odbc?
Why we use while rs next ())?
Name the method, which is used to prepare a callablestatement.