如何配置从Bluemix到本地数据库的连接



我已经在IBM Bluemix上配置了安全网关服务,然后在我的环境中配置了安全门户客户端。两者都已连接。此后,我添加了一个来自云应用程序的连接调用,该调用具有所提供的host:port组合。应用程序收到错误connection refused

我该如何解决这个问题?

在大多数情况下,错误是由以下原因之一引起的:

  • 在安全网关配置中,您必须向本地数据库提供IP地址和端口,从安全网关客户端运行的位置可以看出。您是否提供了正确的IP地址和端口号
  • 数据库服务器上的防火墙正在阻止来自安全网关客户端的访问
  • 安全网关客户端需要一个ACL(访问控制列表)来打开连接
  • 您的数据库未配置为从外部访问。你打开港口了吗
i changed the db type from DB2 As400 to  normal db2. Now i have this error : 
ERR App [err] com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2030][11211][4.12.55] A communication error occurred during operations on the connection's underlying socket, socket input stream,
ERR App or socket output stream.  Error location: Reply.fill() - insufficient data (-1).  Message: Insufficient data. ERRORCODE=-4499, SQLSTATE=08001
ERR App [err]   at com.ibm.db2.jcc.am.hd.a(hd.java:319)
ERR App [err]   at com.ibm.db2.jcc.t4.a.a(a.java:461)
ERR App [err]   at com.ibm.db2.jcc.t4.a.a(a.java:456)
ERR App [err]   at com.ibm.db2.jcc.t4.z.b(z.java:242)
ERR App [err]   at com.ibm.db2.jcc.t4.z.c(z.java:268)
ERR App [err]   at com.ibm.db2.jcc.t4.z.c(z.java:381)
ERR App [err]   at com.ibm.db2.jcc.t4.z.v(z.java:1149)
ERR App [err]   at com.ibm.db2.jcc.t4.ab.a(ab.java:45)
ERR App [err]   at com.ibm.db2.jcc.t4.b.n(b.java:1251)
ERR App [err]   at com.ibm.db2.jcc.t4.b.b(b.java:1123)
ERR App [err]   at com.ibm.db2.jcc.t4.b.d(b.java:717)
ERR App [err]   at com.ibm.db2.jcc.t4.b.c(b.java:703)
ERR App [err]   at com.ibm.db2.jcc.t4.b.a(b.java:391)
ERR App [err]   at com.ibm.db2.jcc.t4.b.<init>(b.java:320)
ERR App [err]   at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:214)
ERR App [err]   at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:460)
ERR App [err]   at java.sql.DriverManager.getConnection(Unknown Source)
ERR App [err]   at java.sql.DriverManager.getConnection(Unknown Source)
ERR App [err]   at wasdev.sample.servlet.DBServlet.getTargetDBConnection(DBServlet.java:136)
ERR App [err]   at wasdev.sample.servlet.DBServlet.doGet(DBServlet.java:57)
ERR App [err]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
ERR App [err]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
ERR App [err]   at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1290)
ERR App [err]   at [internal classes]
ERR App [err]   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
ERR App [err]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
ERR App [err]   at java.lang.Thread.run(Unknown Source)

相关内容

  • 没有找到相关文章

最新更新