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 / rama krishna dwadasi

By using CallableStatement we can call a stored Procedure
from JDBC

CallableStatement:- is an interface available in java.sql
package and is extending PreparedStatement interface.
•It is used to execute stored procedures available in the
database.
•Following is the way to create the CallableStatement object.
a)CallableStatement cs = con.prepareCall(sql);
b)CallableStatement cs = con.prepareCall(sql,int,int);
•One CallableStatement object can be used to invoke one
stored procedure only.
•CallableStatement also provides placeholder mechanism
•Following is the way to invoke the stored procedure.
CallableStatement cs = con.prepareCall(“{call p1 (?,?)}”);

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the two types of java?

1075


Can java arraylist hold different types?

1002


What is a void in java?

1083


What is java util?

978


What is the synonym of string?

1044


Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.

889


Is java written in c?

916


what is the difference between process and thread? : Java thread

931


Can a function return a function?

999


How would overload a function based on return type?

925


Which is faster set or list in java?

987


What is a constructor overloading in java?

992


Name few java.lang classes introduced with java 8 ?

944


Explain about interrupt() method of thread class ?

1072


What are the different conditional statements?

942