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 is callable statement?

Answer Posted / sanjeev gupta

Callable Statemnt Example:- Here we prsent a stored
procedure fetuser(int userid) taht takes user id as
parameter and returns the first_name and last_name column
of the user.
try {
CallableStatement callablestmt =
con.prepareCall("{call fetchuser(?)}");
callablestmt.setInt(1,1);
ResultSet rs1 = callablestmt.executeQuery();
while(rs1.next())
{
String fname = rs1.getString("FIRST_NAME");
String lname = rs1.getString("LAST_NAME");
out.println(fname+" "+lname+ "<br />");
}

} catch (SQLException e) {
e.printStackTrace();
}

Is This Answer Correct ?    21 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by connection string?

932


What are the differences between execute, executequery, and executeupdate?

918


Which package is used for jdbc application?

926


What are the benefits of PreparedStatement over Statement?

961


Which database is used with java?

914


Differentiate between stored procedure and functions?

1021


What is jdbc odbc bridge?

905


What does the jdbc resultset interface?

927


What are devices?

908


What are the differences between stored procedure and functions?

971


What is the full form of jdbc and what is its purpose?

946


How do I check in my code whether a maximum limit of database connections have been reached?

964


What is the most common example type 1 driver?

984


How to use JDBC API to call Stored Procedures?

986


What is sqlwarning and discuss the procedure of retrieving warnings?

972