File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes problem in connecting to DB2 using hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "problem in connecting to DB2 using hibernate" Watch "problem in connecting to DB2 using hibernate" New topic
Author

problem in connecting to DB2 using hibernate

Rama Dev
Greenhorn

Joined: Dec 03, 2004
Posts: 6
Please help me with your suggestions to solve the following problem.

I encountered a DRDA error in an attempt to connect to DB2 database through hibernate and c3PO connection pooling.

DB2 is located in windows-2003 server
JDBC URL: jdbc:db2://<host>:50000/<database>
driver: com.ibm.db2.jcc.DB2Driver (type-4 driver)

Though I could successfully connect to the database using "Driver.connect",
the following exception is thrown when I tried to connect through hibernate.
Using the same code block, I was able to connect to MySQL and SQL Server 2005.


BasicResourcePool: An exception occurred while acquiring a resource.
com.ibm.db2.jcc.c.DisconnectException: [ibm][db2][jcc][t4][2034][11148] Execution failed due to a distribution protocol error that caused deallocation of the conversation.
A DRDA Data Stream Syntax Error was detected. Reason: 0x2110.
at com.ibm.db2.jcc.b.db.l(db.java:927)
at com.ibm.db2.jcc.b.eb.Y(eb.java:1943)
at com.ibm.db2.jcc.b.eb.A(eb.java:629)
at com.ibm.db2.jcc.b.eb.Q(eb.java:510)
at com.ibm.db2.jcc.b.eb.i(eb.java:304)
at com.ibm.db2.jcc.b.eb.a(eb.java:43)
at com.ibm.db2.jcc.b.b.f(b.java:1248)
at com.ibm.db2.jcc.b.b.b(b.java:1140)
at com.ibm.db2.jcc.b.b.s(b.java:924)
at com.ibm.db2.jcc.b.b.b(b.java:607)
at com.ibm.db2.jcc.b.b.a(b.java:593)
at com.ibm.db2.jcc.b.b.<init>(b.java:263)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:163)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:81)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:96)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.acquireResource(C3P0PooledConnectionPool.java:89)
at com.mchange.v2.resourcepool.BasicResourcePool.acquireUntil(BasicResourcePool.java:665)
at com.mchange.v2.resourcepool.BasicResourcePool.access$500(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1204)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:368)
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30293
    
150

Rama,
We have a separate forum for Hibernate. I'll move this for you.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
Don't get me started about those stupid light bulbs.
 
subject: problem in connecting to DB2 using hibernate