連線DB2報錯:ERRORCODE=-4499, SQLSTATE=08004
阿新 • • 發佈:2019-02-19
前言:
前幾天用SQuirrel SQL Client (松鼠客戶端)連線DB2報錯,具體資訊如下:
java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.ibm.db2.jcc.a.pm: [jcc][t4][2057][11264][4.0.100] The application server rejected establishment of the connection.
An attempt was made to access a database,XXXDB , which was either not found or does not support transactions. ERRORCODE=-4499, SQLSTATE=08004
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:206)
思路:
百度or谷歌錯誤程式碼:ERRORCODE=-4499, SQLSTATE=08004
過程:
百度的結果...無力吐槽,每一個有用的。
沒辦法,只能靠谷歌了,google的結果:
真TM的感動,第一個就是答案,附上link:https://www-304.ibm.com/support/docview.wss?uid=swg21443723
裡面告訴我起因是:
Using DCS DB alias or local alias name of the database in the connection string will cause this error.
其實就是資料庫的名字有點問題,可能是使用了別名照成的,需要去看看真實的名字。可以採用下面這個命令檢視:
SELECT CURRENT SERVER FROM SYSIBM.SYSDUMMY1;
或者
db2 list db directory
先用putty直接訪問資料庫所在的linux伺服器,然後切換使用者,查尋所有資料庫(DB2相關命令可以別人的部落格,比如:http://blog.csdn.net/fuwencaho/article/details/20629567)
# su - db2inst1
System Database Directory
Number of entries in the directory = 5
Database 1 entry:
Database alias = XXX_DB_1
Database name = XXX_DB_1
Local database directory = /home/db2inst1
Database release level = 10.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
.....
我以前錯誤的URL是:jdbc:db2://1.1.1.1:50000/XXXDB
根據上面搜出的結果,正確的應該是:jdbc:db2://1.1.1.1:50000/XXX_DB_1.
前幾天用SQuirrel SQL Client (松鼠客戶端)連線DB2報錯,具體資訊如下:
java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.ibm.db2.jcc.a.pm: [jcc][t4][2057][11264][4.0.100] The application server rejected establishment of the connection.
An attempt was made to access a database,XXXDB , which was either not found or does not support transactions. ERRORCODE=-4499, SQLSTATE=08004
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:206)
思路:
百度or谷歌錯誤程式碼:ERRORCODE=-4499, SQLSTATE=08004
過程:
百度的結果...無力吐槽,每一個有用的。
沒辦法,只能靠谷歌了,google的結果:
真TM的感動,第一個就是答案,附上link:https://www-304.ibm.com/support/docview.wss?uid=swg21443723
裡面告訴我起因是:
Using DCS DB alias or local alias name of the database in the connection string will cause this error.
其實就是資料庫的名字有點問題,可能是使用了別名照成的,需要去看看真實的名字。可以採用下面這個命令檢視:
SELECT CURRENT SERVER FROM SYSIBM.SYSDUMMY1;
或者
db2 list db directory
先用putty直接訪問資料庫所在的linux伺服器,然後切換使用者,查尋所有資料庫(DB2相關命令可以別人的部落格,比如:http://blog.csdn.net/fuwencaho/article/details/20629567)
# su - db2inst1
$ db2 list db directory
Number of entries in the directory = 5
Database 1 entry:
Database alias = XXX_DB_1
Database name = XXX_DB_1
Local database directory = /home/db2inst1
Database release level = 10.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
.....
我以前錯誤的URL是:jdbc:db2://1.1.1.1:50000/XXXDB
根據上面搜出的結果,正確的應該是:jdbc:db2://1.1.1.1:50000/XXX_DB_1.