update
This commit is contained in:
Binary file not shown.
@@ -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();
|
||||
|
||||
while(rs.next()) {
|
||||
System.out.print(rs.getInt(2)+" ");
|
||||
System.out.print(rs.getString(1)+" ");
|
||||
System.out.println(rs.getInt(3));
|
||||
}
|
||||
|
||||
ResultSet rs = pst.executeQuery();
|
||||
|
||||
pst.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);
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user