gooogogo
This commit is contained in:
parent
497a7f856b
commit
1a35bf185b
7
.vscode/settings.json
vendored
Normal file
7
.vscode/settings.json
vendored
Normal file
@ -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"
|
||||
]
|
||||
}
|
BIN
DEV3.1/BDD_java/mariadb-java-client-3.2.0.jar
Normal file
BIN
DEV3.1/BDD_java/mariadb-java-client-3.2.0.jar
Normal file
Binary file not shown.
Binary file not shown.
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
0
DEV3.2/Florent/TD4/ADN.java
Normal file
0
DEV3.2/Florent/TD4/ADN.java
Normal file
Loading…
Reference in New Issue
Block a user