AUTO TRENDS

You can get the latest Automobile new's and the latest and upcoming models of BMW,Mercedez Benz,Toyota,Hyundai,Tata..
Popular Technology Articles

Get Latest Tech News, Updates

CallableStatement

Posted by Tharadas179 Wednesday, August 19, 2009

import java.sql.*;
class CallableDemo
{
public static void main(String s[])
{
try{
String name="sun";
String pwd="ktm";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:dsn7");

CallableStatement st=con.prepareCall("{call pselect1(?,?)}");
st.setString(1,"vinu");
st.registerOutParameter(2,Types.VARCHAR);
st.executeUpdate();
String status=st.getString(2);
System.out.println(status);
//con.close();

}catch(Exception e){System.out.println(e);}
}
}

0 comments

Post a Comment