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 is the relationship difference the canvas class and the graphics class?
How infinite loop is declared?
How can you handle java exceptions?
Which method returns the length of a string?
What are the advantages of compiled language?
What is e java?
What is data structure in java?
How are observer and observable used in java programming?
How do you declare a string variable?
What is the difference between delete and delete[]
In case of inheritance what is the execution order of constructor and destructor?
how to open and edit XML file in Weblogic???
Is java same as core java?
What is passing value java?
Are functions objects in java?