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?

Answers were Sorted based on User's Feedback



How to call a Stored Procedure from JDBC?..

Answer / vikneswarank

use callableStatment

Is This Answer Correct ?    2 Yes 0 No

How to call a Stored Procedure from JDBC?..

Answer / 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

How to call a Stored Procedure from JDBC?..

Answer / 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

How to call a Stored Procedure from JDBC?..

Answer / santosh kumar

by callable statement

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

How can we find size of the object ?

5 Answers   CTS, RazorSight,


Which of the following is not an isolation level in the JDBC

0 Answers   CTS,


What do you understand by garbage collection in Java? Can it be forced to run?

0 Answers   TCS,


What is difference between final and finally in java?

0 Answers   Cyient,


Explain the difference between abstract class and interface in java?

0 Answers  


how can u handle run time exception in java? explain with brief explanation with examples?

2 Answers   CTS,


Can we restart a dead thread in java?

0 Answers  


What is sorting algorithm in java?

0 Answers  


What is the difference between constructor and method?

4 Answers  


What is the abstraction?

0 Answers  


What is application tier?

0 Answers  


How do you sort words in java?

0 Answers  


Categories