Guest User

Untitled

a guest
May 30th, 2018
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. private static final String USERNAME = "root";
  2. private static final String PASSWORD = "password";
  3. private static final String CONN_STRING = "jdbc:mysql://local:3306/test";
  4.  
  5. public static void main(String[] args) {
  6. Connection conn = null;
  7.  
  8. try {
  9. conn = DriverManager.getConnection(CONN_STRING,USERNAME,PASSWORD);
  10. System.out.println("Connected");
  11. }catch (SQLException e){
  12. System.err.println(e);
  13. }
  14. }
Add Comment
Please, Sign In to add comment