i have implemented a program which contains desktop application form with several textboxes.
now when i run my application from netbeans.
first it will display two textboxes to type
username and passwords.
and there two buttons to submit and cancel
also i have mysql database called entry.
there is a table called users?
user contains usernames and passwords.
when user type their user name and passwords
application should compare that usernames and passwords with database.
if its correct application should throw a message saying password successful.
here is my code for that:
String boxer = "bob";
while (rs.next()){
String u_1name = rs.getString("username");
String u_2name = rs.getString("password");
if (u_1name==boxer){
System.out.println(u_2name);
JOptionPane.showMessageDialog(null,"successfully completed","This is supposed to be the MessageBox title.",JOptionPane.INFORMATION_MESSAGE);
}
}
this is an example..
without user inputs.. i have created static variable called boxer to test.
my if condition will compare that database value with boxer.
if its okay then it will throw a successful message.
but here in my example, it won't give any message.
i think my code is wrong.
please let me know the way of doing this?