Answer Posted / rama krishna dwadasi
By using CallableStatement we can call a stored Procedure
from JDBC
CallableStatement:- is an interface available in java.sql
package and is extending PreparedStatement interface.
•It is used to execute stored procedures available in the
database.
•Following is the way to create the CallableStatement object.
a)CallableStatement cs = con.prepareCall(sql);
b)CallableStatement cs = con.prepareCall(sql,int,int);
•One CallableStatement object can be used to invoke one
stored procedure only.
•CallableStatement also provides placeholder mechanism
•Following is the way to invoke the stored procedure.
CallableStatement cs = con.prepareCall(“{call p1 (?,?)}”);
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What are constructors in java?
What things should be kept in mind while creating your own exceptions in java?
Why is method overloading not possible by changing the return type in java?
What is a protected void?
Find the value of a specified element of the array arr[i] where 0 <= i <= n-1
What is the use of join method?
What is the finalize method do?
Can we declare an interface as final?
How do you remove an element from an arraylist in java?
What is the final variable?
Can a private method be declared as static?
What are the two environment variables that must be set in order to run any java programs?
Explain super keyword in java.
Is java a virus?
What is append function?