Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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