Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to call a Stored Procedure from JDBC?

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


Please Help Members By Posting Answers For Below Questions

What is mysql driver class name?

1154


What do you mean by checked exceptions?

967


What is variable length arguments in java?

984


what is anonymous class in java?

1045


How is hashcode calculated in java?

1044


How do you reverse a string in java without using string buffer?

1106


What does sizeof return?

1000


What is a map in java?

1005


What is the use of hashmap in java?

1096


What is difference between static class and singleton pattern?

1039


What is the use of flag?

1097


Can we use different return types for methods when overridden?

1010


Is it possible for yielded thread to get chance for its execution again ?

1043


How do you escape json?

1002


Differentiate between a class and an object.

1043