This commit is contained in:
EmmanuelTiamzon
2025-09-16 12:27:47 +02:00
parent 0e1266b545
commit 9e770734ac
2 changed files with 20 additions and 11 deletions

Binary file not shown.

View File

@@ -6,29 +6,38 @@ public class Vote {
public Vote(String[] args) {
this.pays = pays;
}
public Vote() {
try{
Connection cnx = DriverManager.getConnection("jdbc:mariadb://dwarves.iut-fbleau.fr/srivasta","srivasta", "Tiamzon2006");
PreparedStatement pst = cnx.prepareStatement("SELECT * FROM tp1_pays AND tp1_vote;");
try{
PreparedStatement req = cnx.prepareStatement("SELECT * FROM tp1_points;");
ResultSet rs = req.executeQuery();
ResultSet rs = pst.executeQuery();
while(rs.next()) {
System.out.print(rs.getInt(2)+" ");
System.out.print(rs.getString(1)+" ");
System.out.println(rs.getInt(3));
}
pst.close();
rs.close();
cnx.close();
try{
rs.close();
req.close();
cnx.close();
}catch(SQLException e) {
System.err.println("Erreur de connexion : "+e);
}
}catch(SQLException e) {
System.err.println("Erreur SQL ou de connexion : "+e);
}
} catch(SQLException e) {
System.err.println("Erreur de connexion : "+e);
}
}
public static void main(String[] args) {
Vote vote = new Vote();
Vote vote = new Vote(args);
}
}