update
This commit is contained in:
@@ -3,7 +3,23 @@ import java.sql.*;
|
||||
public class Vote {
|
||||
|
||||
private String pays;
|
||||
|
||||
public Vote(String pays) {
|
||||
this.pays = pays;
|
||||
|
||||
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();
|
||||
|
||||
ResultSet rs = pst.executeQuery();
|
||||
|
||||
} catch(SQLException e) {
|
||||
System.err.println("Erreur de connexion : "+e);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user