Link to home
Start Free TrialLog in
Avatar of Ronayne
Ronayne

asked on

jsp/mysql syntax


 Is this syntax correct because it throwsan error for me:  
 ResultSet rs1 = stmt.executeQuery("select password from userdesc where password like \""+pass+"\"" and name like \""+name+"\"");
ASKER CERTIFIED SOLUTION
Avatar of Nick_72
Nick_72

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nick_72
Nick_72

although I prefer single quotes since there's no need for escape characters:

ResultSet rs1 = stmt.executeQuery("select password from userdesc where password like '"+pass+"' and name like '"+name+"'");
If you are doing a like... that I guess you need a % in there as well...


ResultSet rs1 = stmt.executeQuery("select password from userdesc where password like '"+pass+"%' and name like '"+name+"%'");
Avatar of Ronayne

ASKER


Thank you