当前页面: 开发资料首页 → JSP 专题 → 请问这样的select语句对吗?
请问这样的select语句对吗?
摘要: 请问这样的select语句对吗?
executeQuery(
"select * from usertable where u_name="+user.getAccount()+"and u_pwd="+user.getPassword()+"and u_type="+user.getTypeId());
executeQuery(
"select * from usertable where u_name='"+user.getAccount()+"' and u_pwd='"+user.getPassword()+"' and u_type="+user.getTypeId());
楼上对的,连接处要加空格,不然sql语句就错了
怎么加空格啊?能具体点吗?谢谢
="+user.getAccount()+"and
==>
'"+user.getAccount()+"' and //and这里有空格