Error with db2 query using jdbc
Code:
DataSource ds = (DataSource) ctx.lookup("MyConnection");
//MyConnection can be tested fine from websphere
Connection connection = ds.getConnection();
Statement st = connection.createStatement();
st.executeQuery(strRequest);
This query works when it's run from 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;',?,?,?,?,?)
However, I am having a problem when running it from a jsp. I am using websphere 6.1 with IBM RAD - connecting via a DataSource that implements com.ibm.db2.jcc.DB2ConnectionPoolDataSource
I've searched for any similar error on google but can't find anything helpful
The error I'm getting is:
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)
I suspect it's a difference in the JDBC drivers, similar error here https://www-304.ibm.com/support/docview.wss?uid=swg1IC63337
Does the actual name of your stored procedure contain a space in the name? This page describes a fix for an issue (#126896) with similar symptoms:
All Connectivities: When invoking a DB2 z/OS stored procedure that has space in the name, the driver throws SQLException "Literal replacement parsing failed for procedure call to DB2 for z/OS". This has been fixed. (126896)
精彩评论