diff --git a/DEV.3.1/TP1/Vote.class b/DEV.3.1/TP1/Vote.class new file mode 100644 index 0000000..258ae8f Binary files /dev/null and b/DEV.3.1/TP1/Vote.class differ diff --git a/DEV.3.1/TP1/Vote.java b/DEV.3.1/TP1/Vote.java index 28755e2..a789f81 100644 --- a/DEV.3.1/TP1/Vote.java +++ b/DEV.3.1/TP1/Vote.java @@ -2,24 +2,33 @@ import java.sql.*; public class Vote { - private String pays; + private String[] pays; - public Vote(String pays) { + 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("CREATE TABLE Pays (nom_pays varchar(256));"); - pst.executeUpdate(); - PreparedStatement pst = cnx.prepareStatement("INSERT INTO Pays VALUES('Pays-Bas','Italie','Russie'"); - pst.executeUpdate(); + PreparedStatement pst = cnx.prepareStatement("SELECT * FROM tp1_pays AND tp1_vote;"); + ResultSet rs = pst.executeQuery(); + pst.close(); + rs.close(); + cnx.close(); } catch(SQLException e) { System.err.println("Erreur de connexion : "+e); } } + + public static void main(String[] args) { + Vote vote = new Vote(); + + } } \ No newline at end of file diff --git a/DEV.3.1/TP1/mariadb-client.jar b/DEV.3.1/TP1/mariadb-client.jar deleted file mode 120000 index a6a2c3a..0000000 --- a/DEV.3.1/TP1/mariadb-client.jar +++ /dev/null @@ -1 +0,0 @@ -info/mariadb-client.jar \ No newline at end of file