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
Which class is the superclass for every class in java programming?
How can we avoid including a header more than once?
What are the differences between throw and throws?
What is string pool?
how would you implement a thread pool? : Java thread
Give a brief description of java socket programming?
What is the difference between iterator and list iterator?
What do you understand by java virtual machine?
What are the access modifiers in java?
What is defined as false sharing in the context of multithreading?
What does %d do in java?
What is difference between == and === in js?
What is the difference between method overriding and overloading?
What is a singleton factory?
What is lossy conversion in java?