please help
اI have a table named users
It has a field named admin Takes a numeric value either 1 or 0
If it is 1, it is open jframe1, and if it is 0 not opend any jframe
the code is :
String sql = "select * from users where user_name='" + txtusername.getText() + "' and USER_PASS='" + txtuserpass.getText() + "'";
pst = conn.prepareStatement(sql);
rs = pst.executeQuery();
if (rs.next()) {
if (rs.ADMIN ==1);
new form_table2_station().setVisible(true);
} else {
JOptionPane.showMessageDialog(null, "Invalid username or Password");
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}
My question is here in this code
if (rs.ADMIN ==1);
new jframe1().setVisible(true);
admin field is in the table
I'm sure there is an error in the iF sentence
How to write the correct code
thank you