gpt4 book ai didi

java - 使用 jdbc 进行 db2 查询时出错

转载 作者:行者123 更新时间:2023-12-01 15:46:32 25 4
gpt4 key购买 nike

代码:

 DataSource ds = (DataSource) ctx.lookup("MyConnection"); 
//MyConnection can be tested fine from websphere
Connection connection = ds.getConnection();
Statement st = connection.createStatement();
st.executeQuery(strRequest);

此查询在从 SQuirrel 运行时有效:

Call SYSPROC.SPNAME('2011-06-13','23.34.45.123456','EG2813B','1111111111','SDP',' ','N','1','377777777777777;BOKACB;BASICCCCC;KRISHNAAAA;01;344444444444444;BOK;BASIC;KRISHNA;02;','1;2;D;7;D;','1;REASON11;REASON12;2;REASON21;REASON22;D;3;REASON31;REASON32;4;REASON41;REASON42;D;0;;;D;',?,?,?,?,?)

但是,我在从 jsp 运行它时遇到了问题。我正在将 websphere 6.1 与 IBM RAD 结合使用 - 通过实现 com.ibm.db2.jcc.DB2ConnectionPoolDataSource 的 DataSource 进行连接

我在 Google 上搜索过任何类似的错误,但找不到任何有用的内容

我收到的错误是:

8/3/11 13:25:00:076 EDT] 0000002f SystemErr     R com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][10413][10940][3.62.56] **Literal replacement parsing failed for procedure call to DB2 for z/OS**. Failing SQL text Call Call SYSPROC.SPNAME('2011-06-13','23.34.45.123456','EG2813B','1111111111','SDP',' ','N','1','377777777777777;BOKACB;BASICCCCC;KRISHNAAAA;01;344444444444444;BOK;BASIC;KRISHNA;02;','1;2;D;7;D;','1;REASON11;REASON12;2;REASON21;REASON22;D;3;REASON31;REASON32;4;REASON41;REASON42;D;0;;;D;',?,?,?,?,?). ERRORCODE=-4463, SQLSTATE=42601
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.db2.jcc.am.fd.a(fd.java:676)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.db2.jcc.am.fd.a(fd.java:60)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.db2.jcc.am.fd.a(fd.java:103)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.db2.jcc.am.jn.h(jn.java:4096)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.db2.jcc.am.jn.a(jn.java:3047)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.db2.jcc.am.jn.a(jn.java:679)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.db2.jcc.am.jn.executeQuery(jn.java:663)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeQuery(WSJdbcStatement.java:880)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm._jsp._contactHistory._jspService(_contactHistory.java:225)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:87)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1152)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:593)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:489)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:232)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:748)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:122)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
[8/3/11 13:25:00:076 EDT] 0000002f SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)

最佳答案

我怀疑这是 JDBC 驱动程序的差异,这里有类似的错误 https://www-304.ibm.com/support/docview.wss?uid=swg1IC63337

关于java - 使用 jdbc 进行 db2 查询时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6944411/

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