jdbcTemplate异常:like模糊查询报错(Parameter index out of range (1 > number of parameters)

http://cuisuqiang.iteye.com/blog/1480525

 
模糊查询like要这样写
注意Object参数和like语法
 
  1. public static void main(String[] args) {  
  2.     Object[] para = new Object[]{"%c%"};  
  3.     List<Object[]> list = excuteQuery("select * from s_user t where t.userName like ?",para);       
  4.     for (Object[] o : list) {  
  5.         for (Object ob : o) {  
  6.             System.out.print(ob + "-");  
  7.         }  
  8.         System.out.println();  
  9.     }  
  10. }  





原文地址:https://www.cnblogs.com/gossip/p/5358541.html