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 are the types of literals?

1155


What is method overloading in JAVA? Why is it not present in C ?

1090


What is parseint?

997


What are memory tables?

1084


What is the purpose of the runtime class in java programming?

1043


What is pangram in java?

1000


What is the full name of java?

1104


Give differences between Quicksort & Mergesort. When should these sorts be used and what is their running time?

1053


How to convert string to byte array and vice versa?

1071


Is java jre still free?

939


why using interface interface ?

2029


'A class is a template for an object' explain this statement.

1043


What is bytecode in java ?

1172


What does the @override annotation do?

1029


What does java stand for?

1103