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 jdbc and jdbc drivers?

1055


How do I find ojdbc jar version?

977


What are the different classes through which JDBC represents statements?

969


Explain the role of driver in jdbc.

1050


Explain the necessary steps to connect to the database in java?

1091


Why do we need jdbc?

1104


Write an sql to find all records having all numeric characters in a field ?

1022


Which jdbc driver is the fastest driver?

1056


How can I connect mysql or oracle with java?

1006


What are the measures to connect to the db using jdbc?

1117


How can we store and retrieve images from the database?

1003


How will you perform truncation using JDBC?

1054


What does the jdbc resultsetmetadata interface?

993


What is the significance of DataBaseMetaData.tableIndexStatistics? How to obtain and use it?

1037


What are jdbc?

1012