Advertisement
Guest User

Untitled

a guest
May 15th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. public class Data { public void createConnection(){ try { Class.forName("com.mysql.jdbc.Driver"); Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","#","#"); System.out.println("database connection success!"); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement