Topic
  • 1 reply
  • Latest Post - ‏2012-01-17T02:48:21Z by SystemAdmin
PVGC_Girish_B
PVGC_Girish_B
1 Post

Pinned topic Not able to connect to db2 from java

‏2011-11-02T19:35:31Z |
Hi,
I am not able to connect to DB2 database from java, no matter what driver I use.

Class.forName("com.ibm.db2.jcc.DB2Driver");

con = datasource.getConnection();

"Exception in thread "main" com.ibm.db2.jcc.am.yn: jcct4203011211http://3.57.82 A communication error occurred during operations on the connection's underlying socket, socket input stream,
or socket output stream. Error location: Reply.fill(). Message: Insufficient data. ERRORCODE=-4499, SQLSTATE=08001"

I am setting setServerName ,setUser ,setPassword, setDriverType, setPortNumber, setDatabaseName, setPlanName

Is there anything I am missing here?

Jars - db2jcc_lencese_cisuz.jar,db2jcc_jar,db2jcc4.jar,db2jcc_license_cu.jar

Thank you for your help in Advance.
Updated on 2012-01-17T02:48:21Z at 2012-01-17T02:48:21Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1731 Posts

    Re: Not able to connect to db2 from java

    ‏2012-01-17T02:48:21Z  
    have you tried running one of the samples that comes with the client/server installation?
    you can find them under SQLLIB\samples\jdbc