DB2 jdbc驱动程序不支持MERGE?

时间:2014-03-16 23:43:42

标签: jdbc db2 sql-merge

我编写了一个非常简单的MERGE语句,我可以在DB2 Control Center中成功执行,但是当我尝试通过JDBC执行时,它说驱动程序没有能力?这是真的吗?

org.springframework.dao.InvalidDataAccessApiUsageException: PreparedStatementCallback; SQL []; [jcc][t4][1052][13409][4.14.113] Driver not capable. ERRORCODE=-4450, SQLSTATE=0A502; nested exception is com.ibm.db2.jcc.am.SqlFeatureNotSupportedException: [jcc][t4][1052][13409][4.14.113] Driver not capable. ERRORCODE=-4450, SQLSTATE=0A502
    at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:81)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607)
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:824)
    at com.ibm.ecm.sync.core.db.spring.RepositorySpringDAO.createNewRepositoryObjectAndRegistrationIfNotExist(RepositorySpringDAO.java:305)
    at com.ibm.ecm.sync.core.db.spring.RepositorySpringDAO.registerRepositoryObject(RepositorySpringDAO.java:275)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:619)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.ibm.ecm.sync.utils.LogAroundMethod.invoke(LogAroundMethod.java:22)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at com.sun.proxy.$Proxy8.registerRepositoryObject(Unknown Source)
    at com.ibm.ecm.sync.tests.db.db2.RepositoryDB2DAOTests.testRegisterRepositoryObjectForSync(RepositoryDB2DAOTests.java:370)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:619)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: com.ibm.db2.jcc.am.SqlFeatureNotSupportedException: [jcc][t4][1052][13409][4.14.113] Driver not capable. ERRORCODE=-4450, SQLSTATE=0A502
    at com.ibm.db2.jcc.am.ed.e(ed.java:606)
    at com.ibm.db2.jcc.am.ed.d(ed.java:634)
    at com.ibm.db2.jcc.am.Connection.checkDatabaseSupportForSelectFromInsertUpdateDeleteMerge(Connection.java:6370)
    at com.ibm.db2.jcc.am.Connection.checkAutoGeneratedKeysParameter(Connection.java:6409)
    at com.ibm.db2.jcc.am.Connection.checkAutoGeneratedKeysParameter(Connection.java:6424)
    at com.ibm.db2.jcc.am.Connection.prepareStatement(Connection.java:2868)
    at com.ibm.ecm.sync.core.db.spring.RepositorySpringDAO$9.createPreparedStatement(RepositorySpringDAO.java:298)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:585)
    ... 40 more

0 个答案:

没有答案