Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void openConnection() {
- try {
- Class.forName("com.mysql.jdbc.Driver");
- this.connnection = DriverManager.getConnection("jdbc:mysql://46.251.239.17/java_db", "root", "PRIVAT");
- System.out.println("Connection established successfully with the database server.");
- } catch (Exception e) {
- System.err.println("Error: " + e.getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement