cloumn=“name”;
uid=""20160820173746006721;
String sql="SELECT "+cloumn+" FROM p_users where uid='"+uid+"' and state='1' limit 1";
User ps =User.dao.findFirst(sql);
一切正常。
换成如下方式:
String sql="SELECT ? FROM p_users where uid=? and state='1' limit 1";
User ps =User.dao.findFirst(sql,cloumn,uid);
结果变成:
{"?column?": "name"} 请问什么原因,如何解决
项目:JFinal