This commit is contained in:
EmmanuelTiamzon
2025-09-16 10:31:05 +02:00
parent 13de3fd508
commit 3173f3668a
6 changed files with 0 additions and 28 deletions

View File

@@ -0,0 +1,30 @@
import java.sql.*;
public class MonProgramme {
public MonProgramme() {
try {
Connection cnx = DriverManager.getConnection("jdbc:mariadb://dwarves.iut-fbleau.fr/srivasta","srivasta", "Tiamzon2006");
PreparedStatement pst = cnx.prepareStatement("SELECT valeur FROM Mesure WHERE valeur BETWEEN ? AND ?");
pst.setInt(1, 50);
pst.setInt(2, 100);
ResultSet rs = pst.executeQuery();
}catch(SQLException e) {
System.err.println("Connexion echouee : "+e);
}
try {
Class.forName("org.mariadb.jdbc.Driver");
} catch(ClassNotFoundException e) {
System.err.println("Classe non trouvee : "+e);
}
}
public static void main(String[] args) {
MonProgramme monpgr = new MonProgramme();
}
}

BIN
DEV.3.1/TP/TP1/Vote.class Normal file

Binary file not shown.

34
DEV.3.1/TP/TP1/Vote.java Normal file
View File

@@ -0,0 +1,34 @@
import java.sql.*;
public class Vote {
private 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("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();
}
}