[14-7-8 15:30:31:283 CST] 00000074 SystemOut O 2014-07-08 15:30:31,281 com.boco.eoms.commons.log.aop.support.LogBeforeMethodAdvice.before(LogBeforeMethodAdvice.java:52) INFO [com.boco.eoms.commons.log.aop.support.LogBeforeMethodAdvice] - <com.boco.eoms.sheet.base.service.ITaskService.getTaskModelObject()>
[14-7-8 15:30:31:284 CST] 00000074 SystemOut O updateTaskByStatus sql is ----update BroadbandOpened_task set taskStatus = 5 where sheetKey = '4028858e471419c9014714a7cfea0017'
[14-7-8 15:30:31:298 CST] 00000074 SystemErr R java.sql.SQLException: Too many or too few host variables given.
[14-7-8 15:30:31:298 CST] 00000074 SystemErr R at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:398)
[14-7-8 15:30:31:298 CST] 00000074 SystemErr R at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3247)
sql 单独在数据库里执行就没问题,用hibernate就报这个错误,下面是执行sql这块代码
String sql = "update " + tableName + " set taskStatus = " + Constants.TASK_STATUS_FINISHED +" where sheetKey = " + "'"+ sheetKey +"'";
System.out.println("updateTaskByStatus sql is ----"+sql);
pst = conn.prepareStatement(sql);
if(pst!=null){
pst.executeUpdate();
}
------解决方案--------------------
http://www.itpub.net/forum.php?mod=viewthread&tid=1050383&highlight=
------解决方案--------------------
你这个用 hibernate 看不出来。 应该就是 多个相同的字段,hibernate 认不出来绑定到
那个字段上面。