Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Connection connection = null;
- Statement rapport = null;
- ResultSet resultat = null;
- public Connexion() throws ClassNotFoundException, SQLException {
- Class.forName("com.mysql.jdbc.Driver");
- System.out.println("Driver OK...");
- String url = new String ("jdbc:mySql://localhost/alimentation");
- connection = DriverManager.getConnection(url, "root","");
- System.out.println("Connexion Réussie !");
- rapport = (Statement) connection.createStatement();
- }
- public ResultSet afficherGroupe() throws SQLException{
- return rapport.executeQuery("SELECT * FROM `groupe`");
- }
- public ResultSet LireLesSousGroupes(int choix) throws SQLException {
- return rapport.executeQuery("SELECT * FROM `sous_groupe` WHERE grp_id = " + choix);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement