Files
DEV/DEV.3.1/TP/TP1/Vote.java

34 lines
615 B
Java
Raw Normal View History

2025-09-05 19:30:04 +02:00
import java.sql.*;
public class Vote {
2025-09-16 10:27:52 +02:00
private String[] pays;
2025-09-05 19:45:08 +02:00
2025-09-16 10:27:52 +02:00
public Vote(String[] args) {
2025-09-05 19:30:04 +02:00
this.pays = pays;
2025-09-16 10:27:52 +02:00
}
public Vote() {
2025-09-05 19:45:08 +02:00
try{
Connection cnx = DriverManager.getConnection("jdbc:mariadb://dwarves.iut-fbleau.fr/srivasta","srivasta", "Tiamzon2006");
2025-09-16 10:27:52 +02:00
PreparedStatement pst = cnx.prepareStatement("SELECT * FROM tp1_pays AND tp1_vote;");
2025-09-05 19:45:08 +02:00
2025-09-16 10:27:52 +02:00
2025-09-05 19:45:08 +02:00
ResultSet rs = pst.executeQuery();
2025-09-16 10:27:52 +02:00
pst.close();
rs.close();
cnx.close();
2025-09-05 19:45:08 +02:00
} catch(SQLException e) {
System.err.println("Erreur de connexion : "+e);
}
2025-09-05 19:30:04 +02:00
}
2025-09-16 10:27:52 +02:00
public static void main(String[] args) {
Vote vote = new Vote();
}
2025-09-05 19:30:04 +02:00
}