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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| public static boolean identifier(Connection con,String login,String MP) throws SQLException
{
Statement Selection=con.createStatement();
String reqSelection="Select EMPLOYE.Type from Employe where EMPLOYE.login='"+login+"' AND EMPLOYE.mot_de_passe='"+MP+"';";
ResultSet resultat=null;
resultat=Selection.executeQuery(reqSelection);
int Id;
String log,MdP;
if(resultat.next())
{
//Id=resultat.getInt("Id_Employe");
/*log=resultat.getString("login");
MdP=resultat.getString("mot_de_passe");*/
//System.out.println(login + " " + MdP);
return true;
}
else
{
System.out.println("Mauvaise identification!!");
return false;
}
}
public static void Type(Connection con,String login,String MP) throws SQLException
{
Statement Selection=con.createStatement();
String reqSelection="Select EMPLOYE.Type from Employe where EMPLOYE.login='"+login+"' AND EMPLOYE.mot_de_passe='"+MP+"';";
ResultSet resultat=null;
resultat=Selection.executeQuery(reqSelection);
String type;
if(resultat.next())
{
//Id=resultat.getInt("Id_Employe");
/*log=resultat.getString("login");
MdP=resultat.getString("mot_de_passe");*/
type=resultat.getString("type");
System.out.println(type);
if(type=="Employe")
{
IEEmploye toto=new IEEmploye();
toto.setVisible(true);
}
else
{
System.out.println("Vous n'etes pas un employe!!");
}
} |
Partager