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 map java?
can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread
Explain about OOPS concepts and fundamentals.
Why are getters and setters used?
How do you escape json?
how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)
What are voids?
How does linkedlist work in java?
explain the difference between jdk and jvm?
How does compareto method work?
What are the characteristics of java?
What is bufferedwriter?
What is pass by value?
List primitive java types?
What do you mean by object?