I am trying to connect Oracle SQL Developer with DB2 Database.
- I have added
db2jcc4.jar
,db2jcc.jar
anddb2jcc_license_cu.jar
Libraries in "Third Party JDBC Driver" - DB2 tabs appears
- Entered Username and connection Details.
While testing connection, I encounterd below error.
Status : Failure -Test failed: [jcc][t4][2034][11148][4.24.92] Execution failed due to a distribution protocol error that caused deallocation of the conversation.
A DRDA Data Stream Syntax Error was detected. Reason: 0x3. ERRORCODE=-4499, SQLSTATE=58009
Versions:
db2level
: v11.1
./java com.ibm.db2.jcc.DB2Jcc -version
IBM DB2 JDBC Universal Driver Architecture 3.72.44
Jars installed:
echo $CLASSPATH
/db2/coru1db2/home/coru1db2/sqllib/java/db2java.zip:
/db2/coru1db2/home/coru1db2/sqllib/java/sqlj.zip:
/db2/coru1db2/home/coru1db2/sqllib/function:
/db2/coru1db2/home/coru1db2/sqllib/java/db2jcc_license_cu.jar:
/db2/coru1db2/home/coru1db2/sqllib/tools/clpplus.jar:
/db2/coru1db2/home/coru1db2/sqllib/tools/jline-0.9.93.jar:
/db2/coru1db2/home/coru1db2/sqllib/java/db2jcc.jar:
Can someone help me in resolving it?
Best Answer
An error like this might be returned if you will try to connect to a port which is actually not the port DB2 server listens on. E.g. if I would, by mistake, try to connect to port 22 (ssh) I will get the same error:
You can check the port Db2 listens on with:
Db2 will listen on this port if you have DB2COMM=TCPIP set. On there server side you can verify that e.g. with lsof:
$ lsof -p <pid_of_db2sysc> -iTCP -sTCP:LISTEN -a
(all sockets in listening state and -a to AND selections) e.g.
If the server listens only for SSL connections (only
SSL_SVCENAME
set in dbm cfg) then you can test that connection to Db2's SSL port does work e.g. with OpenSSL client:If it is OK then test from Java:
not quite there - you need also sslCertLocation that points to certificate of the database: