Whenever I press log-in it shows the catch message.
tried setting it to ResultSet.getString(name of column in access).equal(value of textfield)
b1.addActionListener(new ActionListener ()
{
public void actionPerformed(ActionEvent e)
{
try
{
String u1=t1.getText();
String u2=t2.getText();
if (u1==rs.getString("Name") || u2==rs.getString("Pass"))
{
JOptionPane.showMessageDialog(null, "Success");
}
}
catch (Exception ex)
{
JOptionPane.showMessageDialog(null, "Invalid");
}
}
});
It always shows catch message which is "Invalid". Also I am using Ucanaccess for my program to connect with MS access.