[英]SQLCODE=-204, SQLSTATE=42704 only on local development server
since today I am getting this weird SQL error on my local development Server. 从今天开始,我在本地开发服务器上收到此奇怪的SQL错误。 The Integration Test machine is fine even if I deploy the same artifacts on both. 即使我在两者上都部署了相同的工件,集成测试机器也可以。
I know this question has been asked before, but none of the answers seemed to solve my problem so far. 我知道以前曾有人问过这个问题,但到目前为止,所有答案似乎都无法解决我的问题。 I already tried to switch from the myBatis ${variable} to #{variable} and back. 我已经尝试从myBatis $ {variable}切换到#{variable}并返回。 And I also tried putting all the table names in doublequotes. 我还尝试将所有表名都放在双引号中。
Here is the error I get for every query I send to my local applicationserver (JBoss 6.1): 这是我发送给本地应用程序服务器(JBoss 6.1)的每个查询的错误:
### Error querying database. Cause: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SCHEME.TABLENAME DRIVER=3.63.75
### The error may exist in path/to/dao/mapper/DAOMapper.xml
### The error may involve path.to.dao.mapper.DAOMapper.daoMethod - inline
### The error occurred while setting parameters
### SQL: SELECT VAL1 as VAL1, VAL2 as VAL2, FROM SCHEME.TABLENAME WHERE VAR1= ( select MAX (VAR1) FROM SCHEME.TABLENAME WHERE VAR2 <= VAR2 ) WITH UR;
### Cause: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SCHEME.TABLENAME, DRIVER=3.63.75; bad SQL grammar []; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SCHEME.TABLENAME, DRIVER=3.63.75: org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SCHEME.TABLENAME, DRIVER=3.63.75
Any Ideas? 有任何想法吗?
Case closed! 结案! As I was writing my comment, saying the two environements use the same database, I thought "Maybe not". 当我写评论时,说两个环境使用同一个数据库,我以为“也许不是”。
Turns out the datasource was configured wrong in the standalone.xml 原来在standalone.xml中数据源配置错误
I still have no idea how that happened though. 我仍然不知道那是怎么发生的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.