SQL语句参数化问题例如:String c500select* fromawhere a.bnot in ( + c + )把这个C用 ? 代替该
SQL语句参数化问题
例如:
String c='500';
"select * from a where a.b not in ( " + c + ")";
把这个C用 ? 代替 该怎么写 sql
[解决办法]
select * from where a.b not in :c
[解决办法]
String c='500';
String sql = "select * from a where a.b not in ( ?)";
List<object[]> o = getsession().createsql(sql).setstring(0, c).list();
大致是这样
