我收到错误代码 -4220,SQL 状态为空。SP“XXXXX”包含 VARGRAPHICS 数据类型。下面是完整的异常堆栈跟踪。SP 执行正常,读取输出参数时出现错误,即成功调用执行方法但 getString 方法出错。
即使我尝试访问任何方法来获取输出参数值,也会出现错误。仅供参考,我尝试使用最新版本的 db2 驱动程序,但错误仍然存在。
com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][3.65.77] Caught java.io.CharConversionException. See attached Throwable for details. ERRORCODE=-4220, SQLSTATE=null
at com.ibm.db2.jcc.am.cd.a(cd.java:682)
at com.ibm.db2.jcc.am.cd.a(cd.java:60)
at com.ibm.db2.jcc.am.cd.a(cd.java:112)
at com.ibm.db2.jcc.am.gc.a(gc.java:2825)
at com.ibm.db2.jcc.am.gc.a(gc.java:582)
at com.ibm.db2.jcc.am.gc.q(gc.java:560)
at com.ibm.db2.jcc.am.gc.N(gc.java:1557)
at com.ibm.db2.jcc.am.gc.a(gc.java:1541)
at com.ibm.db2.jcc.am.CallableStatement.D(CallableStatement.java:941)
at com.ibm.db2.jcc.am.CallableStatement.getString(CallableStatement.java:920)
at com.cst.test.daoLayer.SPTest.callDB2ProcOUTParameter(SPTest.java:118)
at com.cst.test.daoLayer.SPTest.testLogic(SPTest.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.nio.charset.MalformedInputException: Input length = 5
at com.ibm.db2.jcc.am.r.a(r.java:19)
at com.ibm.db2.jcc.am.gc.a(gc.java:2821)
... 28 more
Caused by: sun.io.MalformedInputException
at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:278)
at com.ibm.db2.jcc.am.r.a(r.java:16)
... 29 more