public int AddFiliere(String NouvelleFiliere){
        
        int retour;
        
        if (NouvelleFiliere.isEmpty()){
            return -2;
        }
    
        if (NouvelleFiliere.startsWith(" ")){
            return -4;
        }
        if (NouvelleFiliere.length()>32){
            return -5;
        }
        
        try {
            DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
            Connection con = DriverManager.getConnection(DBURL, DBUSER, DBPASS);
            if (con == null)
                System.out.println("con classe ko ");
            else
                System.out.println("con classe ok ");
            Statement statement = con.createStatement();
            if (statement == null)
                System.out.println("statement classe ko ");
            else
                System.out.println("statement classe ok ");
            
            //System.out.println("test1 : " + SaisieNom.getText());
            
             String ordreSQLControle= "select count(1) from \"FILIERE\" where LIBFILIERE=?";//(select codefiliere from filiere where libfiliere=?))" ;
            
            PreparedStatement etatPrepareControle = con.prepareStatement(ordreSQLControle);
            etatPrepareControle.setString(1,NouvelleFiliere);
            
            
            ResultSet rs=etatPrepareControle.executeQuery();
            rs.next();
            if (rs.getInt(1)!=0){
                
                return -3;
            }
            
            
            String ordreSQL= "insert into \"filiere\"(CODEFILIERE,LIBFILIERE,IDPERS) values(SEQ_FILIERE.nextVAL,?,NULL)";//(select codefiliere from filiere where libfiliere=?))" ;
            
            PreparedStatement etatPrepare = con.prepareStatement(ordreSQL);
            etatPrepare.setString(1,NouvelleFiliere);
            
            
            
            retour=etatPrepare.executeUpdate();
            etatPrepare.close();
            statement.close();
            con.close();
        } catch (SQLException ex) {
            Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
            retour=-1;
        }
        return retour;
        
        
    }