hi everyone
-In the code below, the line marked by *** is where i read my text field.
-The value of the text field is stored into a variable "InputUserName ".
-My question is: What do i put in the place of @@@@@ so as to have the same variable "InputUserName " referenced.
- I want to search/query my db by whatever the user enters as his username.
i'm on jdk1.5.0
Thanx in advance
Driver d = (Driver)Class.forName"sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
String URL = "jdbc:odbc:" + "CMSC446";
con = DriverManager.getConnection( URL ,"","");
statement = con.createStatement();
*** InputUserName = username.getText(); //reading the Text field
result = statement.executeQuery("SELECT password FROM terry
WHERE username =@@@@@");
while(result.next())
{
InputPassword = Inpassword.getText(); //reading password field
String dbPassword = result.getString("password"); //obtaining db password
if (dbPassword.equals(InputPassword))
{
//aknowledge
}
else
{
}
}