update
This commit is contained in:
34
DEV.3.1/TP/TP1/Vote.java
Normal file
34
DEV.3.1/TP/TP1/Vote.java
Normal 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();
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user