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

Why is singleton class used?

1038


If a class is declared without any access modifiers, where may the class be accessed in java programming?

1221


What is a qualifier in a sentence?

993


What is intern method in java?

1084


What is the difference between hashmap and hashtable? What is an interface?

1170


Is array a class in java?

983


What comes to mind when someone mentions a shallow copy in java?

1110


What is the difference between I ++ and ++ I in java?

982


How many arguments can a method have java?

1029


Explain the features of interfaces in java?

983


What is the difference between checked exception and unchecked exception?

1017


What is the difference between variable & constant?

1033


How can we use primitive data types as objects?

961


Can you explain the final method modifier?

1013


Is it necessary that each try block must be followed by a catch block?

1024