update
This commit is contained in:
Binary file not shown.
@@ -6,29 +6,38 @@ public class Vote {
|
|||||||
|
|
||||||
public Vote(String[] args) {
|
public Vote(String[] args) {
|
||||||
this.pays = pays;
|
this.pays = pays;
|
||||||
}
|
|
||||||
|
|
||||||
public Vote() {
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
Connection cnx = DriverManager.getConnection("jdbc:mariadb://dwarves.iut-fbleau.fr/srivasta","srivasta", "Tiamzon2006");
|
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()) {
|
||||||
ResultSet rs = pst.executeQuery();
|
System.out.print(rs.getInt(2)+" ");
|
||||||
|
System.out.print(rs.getString(1)+" ");
|
||||||
|
System.out.println(rs.getInt(3));
|
||||||
|
}
|
||||||
|
|
||||||
pst.close();
|
try{
|
||||||
rs.close();
|
rs.close();
|
||||||
cnx.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) {
|
} catch(SQLException e) {
|
||||||
System.err.println("Erreur de connexion : "+e);
|
System.err.println("Erreur de connexion : "+e);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Vote vote = new Vote();
|
Vote vote = new Vote(args);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user