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...

what r callable statement and give their proper use

Answer Posted / prajal

Callable statement (java.sql.CallableStatement) are used for
calling a Stored Procedure.

Syntax is as below-
//prepare a procedure call
String procedureCall="call testProcedure(:1,:2,:3)";
//prepare a callable statement

CallableStatement
cStmt=connectionObject.prepareCall(procedureCall);

// Set the Input Parameters to the procedure
cStmt.setInt(1, testID);
cStmt.setInt(2, testNumber);

// Register Output Parameters
cStmt.registerOutParameter(3, Types.VARCHAR);

// Execute the Callable Statement
cStmt.execute();

// Resulting Values from the Callable Statement is assigned
to the Message variable
String message = cStmt.getString(3);

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference overloading and overriding?

1172


What is the difference between Grid and Gridbaglayout?

1247


Similarity and difference between static block and static method ?

919


Objects or references which of them gets garbage collected?

969


What does exp mean in math?

991


Can a constructor be protected?

1088


Is the empty set a singleton?

981


How do I get 64 bit java?

1114


What is object-oriented paradigm?

1067


What is the difference between reader/writer and inputstream/output stream?

1084


do I need to use synchronized on setvalue(int)? : Java thread

1012


How to create a custom exception?

995


What is the difference between a loader and a compiler?

1040


What is externalizable interface?

1102


Define how can we find the actual size of an object on the heap?

1209