i was trying to validate my login using this code but it always shows invalid and i tried printing the value of rs variable which is true and there is no error or exception,Here is my code
String sql="SELECT * FROM user_info WHERE password=? and email_id=?";
try
{
ResultSet rs=null;
PreparedStatement ps=mycon.prepareStatement(sql);
ps.setString(1,text_eid.getText());
ps.setString(2,passwordField.getText());
rs=ps.executeQuery();
System.out.println("rs="+rs.next());
boolean b=rs.next();
if(b==true)
{
JOptionPane.showMessageDialog(null, "suc");
}
else
{
JOptionPane.showMessageDialog(null, "invalid");
}
}
catch(Exception er)
{
er.printStackTrace();
}