启用与DB2服务器数据库的JDBC连接

时间:2016-06-15 18:50:58

标签: database jdbc db2

我准备好了DB2服务器设置(DB2安装在可以通过SSH访问的远程服务器上)。

其他地方我有一个应用程序。我希望该应用程序能够通过jdbc连接到该DB2数据库。 该网址如下:jdbc:db2://xxxx.xxx.xxx.xxx:50000/mydb我向其添加了用户和密码。

命令:db2 get db cfg for mydb | grep -i restrict返回Restrict access = NO

数据库的详细信息是

Database alias                       = MYDB
 Database name                        = MYDB
 Local database directory             = /disk1
 Database release level               = 10.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =

如何连接数据库?我尝试使用root和其他用户,但它失败了。

应用程序返回:

Caused by: com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2030][11211][3.69.24] A communication error occurred during operations on the connection's underlying socket, socket input stream, or socket output stream. Error location: Reply.fill() - socketInputStream.read (-1). Message: Connection reset. ERRORCODE=-4499, SQLSTATE=08001

0 个答案:

没有答案
相关问题