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

Which collection is thread safe in java?

970


What is method in java with example?

928


Why are global variables used?

989


What is an object class?

1004


What is the use of toarray () in java?

1051


What are constants and how to create constants in java?

971


What are keyboard events?

1132


What is the use of hashmap in java?

1060


What is data string?

942


What is the full name of java?

1101


Which containers use a flowlayout as their default layout in java programming?

983


What is the static method?

1056


List any five features of java?

1012


How can you share data between two thread in Java?

928


Can you create an object of an abstract class?

993