当前位置: 代码迷 >> Oracle开发 >> SQL语句参数化有关问题
  详细解决方案

SQL语句参数化有关问题

热度:33   发布时间:2016-04-24 07:05:10.0
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();

大致是这样
  相关解决方案