Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package prac5;
- import java.sql.*;
- /**
- *
- * @author Kanu
- */
- public class prac5b {
- public static void main(String arg[]) throws ClassNotFoundException, SQLException{
- Class.forName("com.mysql.jdbc.Driver");
- Connection cn = DriverManager.getConnection("jdbc:mysql://localhost/test","root","");
- CallableStatement cst = cn.prepareCall("{call test2(?, ?)}");
- cst.setInt(1,2);
- cst.registerOutParameter(2, Types.VARCHAR);
- cst.execute();
- System.out.println(cst.getString(2));
- }
- }
Add Comment
Please, Sign In to add comment