0

我们正在从 WAS8 迁移到 Tomcat8。在 Tomcat 中,我们需要使用 Java 中的 IMS 的 JNDI 建立连接。

我在为 IBM IMS 的 JNDI 连接创建“URL”时遇到问题,下面是 IBM IMS JDBC jar 给出的 url 结构

对于 driverType 4 "jdbc:ims://datastoreServer[:port]/databaseName[:property=value;]";

对于 driverType 2 "jdbc:ims:databaseName[:property=value;]";

这就是我创造的

jdbc:ims://xx.xx.xxx.com:4034;datastoreName=XXX34;dpsbOnCommit=true;

但在连接过程中出现错误

Dec 07, 2017 12:55:30 PM org.apache.naming.NamingContext lookup
WARNING: Unexpected exception resolving reference
java.sql.SQLException: Invalid URL syntax: databaseName not specified properly. Correct syntax: jdbc:ims://datastoreServer[:port]/databaseName[:property=value;]
    at com.ibm.ims.jdbc.IMSDriver.parseOptionalPortNumber(IMSDriver.java:1031)
    at com.ibm.ims.jdbc.IMSDriver.connect(IMSDriver.java:211)
    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:307)
    at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:200)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:708)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:642)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:464)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:141)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:115)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:102)
    at org.apache.tomcat.jdbc.pool.DataSourceFactory.createDataSource(DataSourceFactory.java:553)
    at org.apache.tomcat.jdbc.pool.DataSourceFactory.getObjectInstance(DataSourceFactory.java:241)
    at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:94)
    at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:841)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:829)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:829)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152)

上面的问题看起来可以通过正确的 url 参数解决,但现在我得到了错误

java.sql.SQLException: An error occurred reading from the socket input stream: java.net.SocketException: Software caused connection abort: recv failed.
    at com.ibm.ims.jdbc.ConnectionImpl.init(ConnectionImpl.java:309)
    at com.ibm.ims.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:95)
    at com.ibm.ims.jdbc.IMSDriver.connect(IMSDriver.java:450)
    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:307)
    at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:200)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:708)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:642)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:464)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:141)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:115)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:102)
    at org.apache.tomcat.jdbc.pool.DataSourceFactory.createDataSource(DataSourceFactory.java:553)
    at org.apache.tomcat.jdbc.pool.DataSourceFactory.getObjectInstance(DataSourceFactory.java:241)
    at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:94)
    at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:841)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:829)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:166)
    at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1084)
    at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:663)
    at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:256)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.ibm.ims.drda.base.DisconnectException: An error occurred reading from the socket input stream: java.net.SocketException: Software caused connection abort: recv failed.
    at com.ibm.ims.drda.t4.Reply.fill(Reply.java:801)
    at com.ibm.ims.drda.t4.Reply.ensureALayerDataInBuffer(Reply.java:752)
    at com.ibm.ims.drda.t4.Reply.readDssHeader(Reply.java:937)
    at com.ibm.ims.drda.t4.Reply.startSameIdChainParse(Reply.java:132)
    at com.ibm.ims.drda.t4.T4ConnectionReply.readExchangeServerAttributes(T4ConnectionReply.java:710)
    at com.ibm.ims.drda.t4.T4Connection.readServerAttributesAndKeyExchange(T4Connection.java:283)
    at com.ibm.ims.drda.t4.T4Connection.flowServerAttributesAndKeyExchange(T4Connection.java:263)
    at com.ibm.ims.drda.t4.T4Connection.flowDRDAConnect(T4Connection.java:248)
    at com.ibm.ims.drda.t4.T4Connection.flowConnect(T4Connection.java:231)
    at com.ibm.ims.drda.t4.T4Connection.initialize(T4Connection.java:218)
    at com.ibm.ims.drda.t4.T4Connection.<init>(T4Connection.java:84)
    at com.ibm.ims.drda.db.DRDAEngine.establishAuthenticatedSocketConnection(DRDAEngine.java:205)
    at com.ibm.ims.jdbc.ConnectionImpl.init(ConnectionImpl.java:258)
    ... 31 more
Caused by: java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at com.ibm.ims.drda.t4.Reply.fill(Reply.java:796)
    ... 43 more
4

1 回答 1

0

对于 Type-4 连接 URL:

jdbc:ims://datastoreServer[:port]/databaseName[:property=value;]

如果您使用的是 IMS 目录,则应将 databaseName 占位符替换为您的PSB 名称

或与

class://your.fully.qualified.PSBNameDatabaseView

如果您使用的是本地元数据文件

于 2018-03-27T21:51:08.810 回答