gpt4 book ai didi

db2 - 使用空SQL状态获取错误代码4220

转载 作者:行者123 更新时间:2023-12-03 09:51:17 24 4
gpt4 key购买 nike

我收到错误代码-4220,SQL状态为空。SP“XXXXX”包含VARGRAPHICS数据类型。以下是完整的异常堆栈跟踪。 SP正常执行,读取输出参数时即出现错误,即成功调用了execute方法,但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

最佳答案

我通过使用最新版本的jar并在系统属性下面进行设置来解决此问题。

System.setProperty("db2.jcc.charsetDecoderEncoder", "3");

另一种方法是在DB2 SP中为char和varchar类型禁用unicode编码,这也对我有用。

关于db2 - 使用空SQL状态获取错误代码4220,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16910791/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com