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 string in java?

969


What is the purpose of the file class in java programming?

970


How do you add an arraylist to an array in java?

939


What is better- service oriented or batch oriented solutions?

2160


What does this () mean in constructor chaining concept?

1063


Can a constructor have different name than a class name in java?

1104


What is mvc in java?

970


Is object a data type in java?

1067


What is difference between fileinputstream and filereader in java?

1017


Why java does not support pointers?

991


What is the difference between hashset and treeset in java?

1020


What is double parsedouble in java?

973


What is a substitution variable?

979


Why can we not override static method?

1071


What is a boolean output?

926