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 databasemetadata interface?

1059


What is difference between odbc and jdbc?

1031


Explain about column name and getter method?

1073


What is in term of jdbc a datasource?

920


What is the meaning of connection?

974


How can you use preparedstatement in jdbc?

1001


How can I manage special characters when I execute an insert query?

948


Does the database server have to be running Java or have Java support in order for my remote JDBC client app to access the database?

977


What are jdbc and its components?

988


What is the benefit of having jdbcrowset implementation? Why do we need a jdbcrowset like wrapper around resultset?

962


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

962


When do we use execute method in java jdbc?

995


How can I use the JDBC API to access a desktop database like Microsoft Access over the network?

1022


What is jdbc thin client?

972


What are the different types of classes in the api component?

973