Advertisement
Guest User

Untitled

a guest
Nov 29th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.*;
  4. import org.*;
  5. import com.mysql.jdbc.Driver;
  6.  
  7.  
  8. public class JdbcLogin {
  9. public String Login;
  10. public String MotDePasse;
  11. private boolean Logged = false;
  12.  
  13. public void StartBdd(){
  14. String driverName = "com.mysql.jdbc.Driver";
  15. Class.forName(driverName); // here is the ClassNotFoundException
  16.  
  17. String serverName = "localhost";
  18. String mydatabase = "suptodo";
  19. String url = "jdbc:mysql://" + serverName + "/" + mydatabase;
  20.  
  21. String username = "root";
  22. String password = "azerty";
  23. Connection connection = DriverManager.getConnection(url, username, password);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement