Advertisement
Guest User

picardo

a guest
Nov 29th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. public class Connexion {
  2.  
  3. Connection connection = null;
  4. Statement rapport = null;
  5. ResultSet resultat = null;
  6.  
  7. public Connexion() throws ClassNotFoundException, SQLException {
  8. Class.forName("com.mysql.jdbc.Driver");
  9. System.out.println("Driver OK...");
  10.  
  11. String url = new String ("jdbc:mySql://localhost/tournois_tennis");
  12.  
  13. connection = DriverManager.getConnection(url, "root","");
  14. System.out.println("Connexion Réussie !");
  15.  
  16. rapport = (Statement) connection.createStatement();
  17. }
  18.  
  19. public ResultSet afficherGroupe() throws SQLException{
  20. return rapport.executeQuery("SELECT * FROM `tournois`");
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement