Advertisement
Guest User

Untitled

a guest
Sep 12th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public void openConnection() {
  2. try {
  3. Class.forName("com.mysql.jdbc.Driver");
  4. this.connnection = DriverManager.getConnection("jdbc:mysql://46.251.239.17/java_db", "root", "PRIVAT");
  5. System.out.println("Connection established successfully with the database server.");
  6. } catch (Exception e) {
  7. System.err.println("Error: " + e.getMessage());
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement