Advertisement
siekier

Untitled

Mar 26th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4.  
  5. public class App {
  6.     public static void main(String[] args) throws SQLException, ClassNotFoundException {
  7.         // Load the JDBC driver
  8.         Class.forName("org.mariadb.jdbc.Driver");
  9.         System.out.println("Driver loaded");
  10.  
  11.         // Try to connect
  12.         Connection connection = DriverManager.getConnection
  13. //      ("jdbc:mariadb://localhost:3306/test", "test", "test");
  14.         ("jdbc:mariadb://82.177.146.148:3306/test", "test", "test");
  15.  
  16.         System.out.println("It works!");
  17.  
  18.         connection.close();
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement