Answer Posted / gajendra
We can use CallableStatement interface to call a stored
procedure.Use the following steps.
1. crate the escape syntax like
String sql="{call procname(?,?,?);
2.CallableStatement cst=con.prepareCall(sql);
3.Set the inparameters using setXXX methods like
cst.setInt(1,10);
cst.setString(2,"abc");
4.Register the out parameter
cst.registerOutParameter(1,Types.Float);
5.Submit the statement using
cst.execute();
6. We can get the data from stored procedure using getXXX
methods
| Is This Answer Correct ? | 4 Yes | 4 No |
Post New Answer View All Answers
What are the types of literals?
What is method overloading in JAVA? Why is it not present in C ?
What is parseint?
What are memory tables?
What is the purpose of the runtime class in java programming?
What is pangram in java?
What is the full name of java?
Give differences between Quicksort & Mergesort. When should these sorts be used and what is their running time?
How to convert string to byte array and vice versa?
Is java jre still free?
why using interface interface ?
'A class is a template for an object' explain this statement.
What is bytecode in java ?
What does the @override annotation do?
What does java stand for?