feat: fix user mysql
This commit is contained in:
parent
9b5ca90d85
commit
bebc5fce87
Binary file not shown.
@ -22,7 +22,7 @@ public class utilisateurMysql {
|
|||||||
private Connection theConnection;
|
private Connection theConnection;
|
||||||
|
|
||||||
public utilisateurMysql() {
|
public utilisateurMysql() {
|
||||||
Connexion connexion = new Connexion("127.0.0.1", "bdclient", "java", "java");
|
Connexion connexion = new Connexion("127.0.0.1", "bdPersonnel", "java", "java");
|
||||||
this.theConnection = connexion.getConnection();
|
this.theConnection = connexion.getConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,10 +30,12 @@ public class utilisateurMysql {
|
|||||||
Utilisateur util = null;
|
Utilisateur util = null;
|
||||||
try {
|
try {
|
||||||
PreparedStatement prepStmt = null;
|
PreparedStatement prepStmt = null;
|
||||||
String sql = "SELECT * FROM utilisateur WHERE login=? AND mdp=MD5(?) ";
|
String sql = "SELECT * FROM utilisateur WHERE login=? AND mdp=?";
|
||||||
prepStmt = theConnection.prepareStatement(sql);
|
prepStmt = theConnection.prepareStatement(sql);
|
||||||
prepStmt.setString(1, login);
|
prepStmt.setString(1, login);
|
||||||
prepStmt.setString(2, mdp);
|
prepStmt.setString(2, mdp);
|
||||||
|
System.out.println(login);
|
||||||
|
System.out.println(mdp);
|
||||||
ResultSet result = prepStmt.executeQuery();
|
ResultSet result = prepStmt.executeQuery();
|
||||||
if (result.next()) {
|
if (result.next()) {
|
||||||
util = new Utilisateur(result.getString(1), result.getString(2),
|
util = new Utilisateur(result.getString(1), result.getString(2),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user