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

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

948


What is the difference between jdbc and odbc?

927


What is connection data?

856


What does executeupdate return in jdbc?

921


What is sqlwarning and discuss the procedure of retrieving warnings?

953


What is represented by the connection object?

1015


Explain about Join?

961


How to rollback a JDBC transaction?

1031


What is namedparameterjdbctemplate?

933


What is a merge field?

887


What is a statement in java?

852


Compare jdbc and odbc and how is jdbc required in this context.

870


Prepared statements are faster. Why?

997


What is jdbc type?

846


How many types of jdbc drivers are available?

884