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
What is string builder?
In which order the iterator iterates over collection?
How many bits is a boolean?
What is the length of a string?
How does list work in java?
In how many ways we can do synchronization in java?
Can you make a constructor final?
What is class variable java?
Can we serialize static variables in java?
How to provide security in java
Explain the use of sublass in a java program?
What is the full form of jpeg?
What is static import in java?
Can inner class final?
Can we override private method in java?