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 reference variables in java?
Can we overload run() method in java?
What type of language is java?
What is the symbol for average?
How do you sort a string in java?
What does flag mean in java?
How is abstraction implemented in java ?
What is the difference between yielding and sleeping in java programming?
Differentiate between vector and array list.
How does arraylist size increase in java?
What is the difference between object oriented programming language and object based programming language?
How to read and write image from a file ?
What is canonical name in java?
What is navigable map in java?
What is a buffer in computer?