Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.Statement;
  3.  
  4. try {
  5. Class.forName("com.mysql.jdbc.Driver");
  6.  
  7. // parametry bazy danych
  8. String url = "jdbc:mysql://localhost:3306/komis";
  9. String user = "root";
  10. String password = "";
  11.  
  12. //tworzymy polaczenie z baza danych
  13. Connection connection = DriverManager.getConnection(url, user, password);
  14.  
  15. return connection;
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement