/**
* 存储过程的调用
*
* @author 宋鹏飞
*
*/
public class Demo08 {
final static String url = "jdbc:mysql://localhost/test";
final static String user = "root";
final static String password = "root";
public static void main(String[] args) {
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection(url, user, password);
CallableStatement call = conn
.prepareCall("{call procedure3(?,?,?)}");
call.setString(1, "s");
call.setString(2, "123");
call.setString(3, "so@a.com");
call.execute();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
* 存储过程的调用
*
* @author 宋鹏飞
*
*/
public class Demo08 {
final static String url = "jdbc:mysql://localhost/test";
final static String user = "root";
final static String password = "root";
public static void main(String[] args) {
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection(url, user, password);
CallableStatement call = conn
.prepareCall("{call procedure3(?,?,?)}");
call.setString(1, "s");
call.setString(2, "123");
call.setString(3, "so@a.com");
call.execute();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}