Guest User

Untitled

a guest
Nov 8th, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4.  
  5. public class Main {
  6. static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
  7. static final String DB_URL = "jdbc:mysql://localhost/logiccompany";
  8. public static void main(String[] args) {
  9. try {
  10. Class.forName(JDBC_DRIVER);
  11. } catch (ClassNotFoundException e) {
  12. e.printStackTrace();
  13. }
  14.  
  15. try {
  16. Connection conn = DriverManager.getConnection(DB_URL,"root","1997");
  17. } catch (SQLException e) {
  18. e.printStackTrace();
  19. }
  20. }
  21. }
Add Comment
Please, Sign In to add comment