what r callable statement and give their proper use
Answer Posted / prajal
Callable statement (java.sql.CallableStatement) are used for
calling a Stored Procedure.
Syntax is as below-
//prepare a procedure call
String procedureCall="call testProcedure(:1,:2,:3)";
//prepare a callable statement
CallableStatement
cStmt=connectionObject.prepareCall(procedureCall);
// Set the Input Parameters to the procedure
cStmt.setInt(1, testID);
cStmt.setInt(2, testNumber);
// Register Output Parameters
cStmt.registerOutParameter(3, Types.VARCHAR);
// Execute the Callable Statement
cStmt.execute();
// Resulting Values from the Callable Statement is assigned
to the Message variable
String message = cStmt.getString(3);
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
What is the major difference between linkedlist and arraylist?
When parseint method can be used?
Write a program to print all permutations of string?
How do you sort an array in java?
What is a function easy definition?
What does singleton mean in java?
what do you understand by the term string with respect to java?
What do you mean by synchronized non access modifier?
What is hashtable and explain features of hashtable?
What is called module?
What does t in java mean?
Can we extend singleton class?
Can java list be null?
Why there are some null interface in java? What does it mean?