Guest User

Untitled

a guest
May 10th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Connection connection = ConnectToMeetDB.getConnection("root", "asdASD123", "176.59.138.112", 3306);
  2.  
  3. public static Connection getConnection(String userName, String password, String serverName, int portNumber) throws SQLException {
  4.  
  5. Connection conn = null;
  6. Properties connectionProps = new Properties();
  7. connectionProps.put("user", userName);
  8. connectionProps.put("password", password);
  9. connectionProps.put("useSSL", "false");
  10.  
  11. conn = DriverManager.getConnection(
  12. "jdbc:mysql://" +
  13. serverName +
  14. ":" + portNumber + "/" + "meetdb",
  15. connectionProps);
  16. return conn;
  17. }
Add Comment
Please, Sign In to add comment