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 the relationship difference the canvas class and the graphics class?

1002


How infinite loop is declared?

962


How can you handle java exceptions?

960


Which method returns the length of a string?

976


What are the advantages of compiled language?

1015


What is e java?

1016


What is data structure in java?

932


How are observer and observable used in java programming?

961


How do you declare a string variable?

955


What is the difference between delete and delete[]

1402


In case of inheritance what is the execution order of constructor and destructor?

1053


how to open and edit XML file in Weblogic???

1928


Is java same as core java?

1035


What is passing value java?

993


Are functions objects in java?

1028