public String Connexion(String username, String password){
        
        try{
            session.beginTransaction();
            Query req = session.createQuery("SELECT membre.motPasse, type.typeDescFr FROM BiMembres membre, BiTypesmembres type WHERE membre.login = '"
                    + username + "' AND type.typeMembre =  membre.biTypesmembres.typeMembre");
            Object[] resSQL = (Object[])req.uniqueResult();
            
            String userPassword = null;
            String userType = "invite";
            
            userPassword = (String)resSQL[0];
             
            MessageDigest md = MessageDigest.getInstance("MD5");
            byte[] md5 = new byte[64];
            md.update(password.getBytes("UTF-8"),0,password.length());        
            md5 = md.digest();
            
            if(convertedToHex(md5).equals(userPassword)){
            
                userType = (String)resSQL[1];
            
                if(userType.equals("Employé")){
                    userType = "employe";
                }
                else
                {
                    userType = "membre";
                }
    
                return userType;
            }
            
            return userType;
            
        }catch(Exception e){
            return null;
        }
    }