Advertisement
Guest User

Untitled

a guest
Oct 5th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public static void main(String[] args) throws Exception {
  2. Connection connection = getMySqlConnection();
  3. CallableStatement proc = connection.prepareCall("{ call LCD_GetDispInfoAllTimeTable() }");
  4. proc.registerOutParameter(1, Types.INTEGER);
  5. proc.execute();
  6. int returnValue = proc.getInt(1);
  7. System.out.println(returnValue + "");
  8. // conn.close();
  9. }
  10.  
  11.  
  12. public static Connection getMySqlConnection() throws Exception {
  13. String driver = "com.mysql.jdbc.Driver";
  14. String url = "jdbc:mysql://10.8.3.70:3306/mpklocal";
  15. String username = "root";
  16. String password = "eltegpslubin";
  17.  
  18. Class.forName(driver);
  19. Connection conn = DriverManager.getConnection(url, username, password);
  20. return conn;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement