I' m trying to get a specific data using the select where statement.I have a database that works fine. What i ve done till now is this
while (rs.next()){
String username2=rs.getString("username");
if(puname.equals(username2)) {
System.out.println(puname);
String queryPass= "select password from userdata where username="+username2;
rs2 = st.executeQuery(queryPass);
String passdb=rs2.getString("password");
System.out.println("pass"+passdb);
end the error that i get is Unknown column 'john' in 'where clause'
PreparedStatement.