-
Java database statment problem
about 9 years ago
-
about 9 years ago
Update your section of code with :
PreparedStatement statement = connection.prepareStatement(sql);
//here username and password should be replaced with the variables that hold their values in your code
**statement .setParameterList(1,username);
statement .setParameterList(2,password);**
ResultSet resultSet = statement.executeQuery();
-
-
about 9 years ago
Hi Jake
You need to set value in query as below :String sql = "SELECT * FROM Student WHERE userName='user' AND password='password'"
-
2 Answer(s)