Salve ragazzi.
ho un metodo dentro un JSp che sto creando.
A questo metodo passo due stringhe che rappresentano utente e password di una tabella che ho creato.
il metodo mi restituisce vero se utente e password esistono, altrimenti false.
il problema è che mi restituisce sempre false.
mi date una mano???
codice:
public boolean esisteUtente(String user, String password) throws SQLException{
System.out.println("stampo: "+user +" "+password);
rowSet.setCommand("SELECT * FROM LOGIN WHERE NOMEUTENTE = ? and Password = ?");
rowSet.setString(1,user);
rowSet.setString(2,password);
rowSet.execute();
if(rowSet.getRow()>0){
System.out.println("restituisco true");
return true;
}
System.out.println("restituisco false");
return false;
}