-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: net.DB2Driver issue
PostPosted: Wed Sep 08, 2004 11:49 am 
Newbie

Joined: Fri Apr 16, 2004 8:49 am
Posts: 3
Hibernate version:2.1.16

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in file [C:\projects\invendu\implementation\conf\test\applicationContext-hibernate.xml]: Initialization of bean failed; nested exception is java.lang.AbstractMethodError: COM.ibm.db2.jdbc.net.DB2DatabaseMetaData.supportsResultSetType(I)Z
java.lang.AbstractMethodError: COM.ibm.db2.jdbc.net.DB2DatabaseMetaData.supportsResultSetType(I)Z
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1155)


Name and version of the database you are using:

DB2 7.2

Debug level Hibernate log excerpt:

Hibernate.properties:

hibernate.connection.driver_class=COM.ibm.db2.jdbc.net.DB2Driver
hibernate.connection.url=...
hibernate.connection.username=...
hibernate.connection.password=...


Environment:

Swing, Spring, Hibernate, DB2, Windows


Problem:

I'm developping a rich client app and i need to use the JDBC COM.ibm.db2.jdbc.net.DB2Driver to connect to DB2 to because no DB2 client will be installed on the users workstations (and therefore i can not use the COM.ibm.db2.jdbc.app.DB2Driver, which works fine).
I get this error when Hibernate sets up the connection: java.lang.AbstractMethodError: COM.ibm.db2.jdbc.net.DB2DatabaseMetaData.supportsResultSetType(I)Z

So the problem is that this method is not abstract in the db2java.zip file including the app.DB2Driver but is abstract in the db2java.zip file including the net.DB2Driver.

I managed to get around that by commenting out the code in Hibernate in the method 'public static Settings buildSettings(Properties properties)' in 'SettingsFactory.java':

Connection conn = connections.getConnection();
try {
DatabaseMetaData meta = conn.getMetaData();
//metaSupportsScrollable = meta.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE);
if ( ( batchSize > 0 ) && !meta.supportsBatchUpdates() ) batchSize = 0;

So my questions are:
- what is the impact of removing this line of code?
- Is there anything that can be done on the Hibernate development side?
- Is there any other solution to make the COM.ibm.db2.jdbc.net.DB2Driver work with my environment?


Many thanks for that, and congratulation again on this great framework

Fabster.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.