Bonsoir!!
voilà je dois creer un mini projet et j'ai 3 types de personnes!! Et je voudrais que lorsque une personne clic sur connexion et bien elle affiche la page correspondant à la personne(3 personnes=3pages differentes!)
donc j'ai tenté de faire une comparaison mais ca ne fonctionne pas!!!
voici mon code pour la comparaison!!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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!!");
                        }
 
 
  					}
J'ai oublié de vous dire lors de l'inscription les utilisateur utilise une liste deroulante pour choisir leur type!!(je travaille sous netbeans!!)

Merci d'avance
krikri