Guest User

Untitled

a guest
Feb 4th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package prac5;
  7. import java.sql.*;
  8. /**
  9. *
  10. * @author Kanu
  11. */
  12. public class prac5b {
  13.  
  14. public static void main(String arg[]) throws ClassNotFoundException, SQLException{
  15.  
  16. Class.forName("com.mysql.jdbc.Driver");
  17. Connection cn = DriverManager.getConnection("jdbc:mysql://localhost/test","root","");
  18. CallableStatement cst = cn.prepareCall("{call test2(?, ?)}");
  19. cst.setInt(1,2);
  20. cst.registerOutParameter(2, Types.VARCHAR);
  21. cst.execute();
  22. System.out.println(cst.getString(2));
  23.  
  24. }
  25.  
  26. }
Add Comment
Please, Sign In to add comment