diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..81813dc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.referencedLibraries": [ + "lib/**/*.jar", + "DEV3.1/BDD_java/mariadb-java-client-3.2.0.jar", + "c:\\Users\\simon\\Downloads\\mysql-connector-j-8.2.0.jar" + ] +} \ No newline at end of file diff --git a/DEV3.1/BDD_java/mariadb-java-client-3.2.0.jar b/DEV3.1/BDD_java/mariadb-java-client-3.2.0.jar new file mode 100644 index 0000000..20a6e72 Binary files /dev/null and b/DEV3.1/BDD_java/mariadb-java-client-3.2.0.jar differ diff --git a/DEV3.1/BDD_java/vote.class b/DEV3.1/BDD_java/vote.class index 27c0b18..85c4f56 100644 Binary files a/DEV3.1/BDD_java/vote.class and b/DEV3.1/BDD_java/vote.class differ diff --git a/DEV3.1/BDD_java/vote.java b/DEV3.1/BDD_java/vote.java index 6cd23bd..9954575 100644 --- a/DEV3.1/BDD_java/vote.java +++ b/DEV3.1/BDD_java/vote.java @@ -11,14 +11,15 @@ public class vote try { + Class.forName("org.mariadb.jdbc.Driver"); Connection cnx = DriverManager.getConnection("jdbc:mariadb://dwarves.iut-fbleau.fr/sayebabu","sayebabu", "kjrzB5S4kqKAwdT"); try { - PreparedStatement pst = cnx.prepareStatement("SELECT PaysID FROM `Pays` WHERE Pays = '?'"); + PreparedStatement pst = cnx.prepareStatement("SELECT PaysID FROM `Pays` WHERE Pays = ?"); pst.setString(1, args[0]); ResultSet rs = pst.executeQuery(); int paysID = rs.getInt(1); - pst = cnx.prepareStatement("SELECT PaysVoteID, Points FROM `Comp` WHERE PaysCompID = '?'"); + pst = cnx.prepareStatement("SELECT PaysVoteID, Points FROM `Comp` WHERE PaysCompID = ?"); pst.setInt(1, paysID); int sumVote = 0; @@ -28,7 +29,7 @@ public class vote int votants = rs.getInt(2); sumVote+=votants; - PreparedStatement pst2 = cnx.prepareStatement("SELECT Pays FROM `Pays` WHERE PaysID = '?'"); + PreparedStatement pst2 = cnx.prepareStatement("SELECT Pays FROM `Pays` WHERE PaysID = ?"); pst2.setInt(1, comp); ResultSet rs2 = pst.executeQuery(); rs2.next(); @@ -43,13 +44,13 @@ public class vote catch (Exception e) { cnx.close(); - System.out.printf("TA MERE"); + System.out.printf("TA MERE2"+e); } } catch (Exception e) { - System.out.printf("TA MERE"); + System.out.printf("TA MERE1"+ e); } } } diff --git a/DEV3.2/Florent/TD4/ADN.java b/DEV3.2/Florent/TD4/ADN.java new file mode 100644 index 0000000..e69de29