Exception in thread "main" org.nutz.dao.DaoException: !Nutz SQL Error: 'select count(1) from (select * from hospital where hospitalname='四川大学华西医院') as nutz_tmp_1461553010779'
PreparedStatement:
'select count(1) from (select * from hospital where hospitalname='四川大学华西医院') as nutz_tmp_1461553010779'
CaseMessage=DB2 SQL Error: SQLCODE=-20521, SQLSTATE=428HV, SQLERRMC=;7, DRIVER=3.63.75
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:96)
at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:316)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:59)
at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:239)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:271)
at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:235)
at org.nutz.dao.impl.NutDao.execute(NutDao.java:983)
at org.nutz.dao.util.Daos.queryCount(Daos.java:360)
at com.gd.cmp.test.DataBaseTest.main(DataBaseTest.java:18)
Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-20521, SQLSTATE=428HV, SQLERRMC=;7, DRIVER=3.63.75
at com.ibm.db2.jcc.am.fd.a(fd.java:679)
at com.ibm.db2.jcc.am.fd.a(fd.java:60)
at com.ibm.db2.jcc.am.fd.a(fd.java:127)
at com.ibm.db2.jcc.am.yn.c(yn.java:2644)
at com.ibm.db2.jcc.am.yn.d(yn.java:2632)
at com.ibm.db2.jcc.am.yn.a(yn.java:2097)
at com.ibm.db2.jcc.t4.cb.h(cb.java:141)
at com.ibm.db2.jcc.t4.cb.b(cb.java:41)
at com.ibm.db2.jcc.t4.q.a(q.java:32)
at com.ibm.db2.jcc.t4.sb.i(sb.java:135)
at com.ibm.db2.jcc.am.yn.gb(yn.java:2066)
at com.ibm.db2.jcc.am.yn.a(yn.java:3120)
at com.ibm.db2.jcc.am.yn.a(yn.java:681)
at com.ibm.db2.jcc.am.yn.executeQuery(yn.java:665)
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:199)
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:45)
... 8 more
4 回复
select count(1) from (select * from hospital where hospitalname='四川大学华西医院') as nutz_tmp_1461555177968
生成的sql看好像不是 是生成的 as 后面生成了以开头的问题 去掉执行就对了
添加回复
请先登陆