-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataAccessSept.java
More file actions
32 lines (29 loc) · 1.2 KB
/
DataAccessSept.java
File metadata and controls
32 lines (29 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
public class DataAccess
{
private Utilisateur user;
public Utilisateur getConnect(Connect connect) throws ConnexionException
{
try
{
Connection connexion = Singleton.getInstance();
String instructionSQL = "select * from Utilisateur where Login = ? and Password = ? ";
PreparedStatement prepStat = connexion.prepareStatement(instructionSQL);
prepStat.setString(1,connect.getLogin());
prepStat.setString(2,connect.getPassword());
ResultSet donnees = prepStat.executeQuery(); // Ici que ça plante
while (donnees.next())
{
user = new Utilisateur(donnees.getString("Login"), donnees.getString("Password"), donnees.getString("Nom"), donnees.getString("Prenom"), donnees.getString("Fonction"));
}
}
catch(SQLException e)
{
throw new ConnexionException(e.getMessage());
}
catch (Exception e)
{
e.getMessage();
}
return user;
}
}