-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate with DB2
PostPosted: Fri Sep 23, 2005 6:57 am 
Newbie

Joined: Fri Sep 23, 2005 6:46 am
Posts: 12
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: hibernate-3.0.5

I used the example at http://www.hibernate.org/hib_docs/v3/re ... orial.html
However the table I used was different.
Also, instead of HSQLDB I used IBM DB2

Mapping documents:

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

Full stack trace of any exception that occurs:
D:\Dhanya\Projects\FastForward\Test>C:\apache-ant-1.6.5\bin\ant.bat run -Daction
=list
Buildfile: build.xml

clean:
[delete] Deleting directory D:\Dhanya\Projects\FastForward\Test\bin
[mkdir] Created dir: D:\Dhanya\Projects\FastForward\Test\bin

copy-resources:
[copy] Copying 3 files to D:\Dhanya\Projects\FastForward\Test\bin

compile:
[javac] Compiling 3 source files to D:\Dhanya\Projects\FastForward\Test\bin

run:
[java] 16:26:00,748 INFO Environment:464 - Hibernate 3.0.5
[java] 16:26:00,748 INFO Environment:477 - hibernate.properties not found
[java] 16:26:00,764 INFO Environment:510 - using CGLIB reflection optimize
r
[java] 16:26:00,764 INFO Environment:540 - using JDK 1.4 java.sql.Timestam
p handling
[java] 16:26:00,842 INFO Configuration:1110 - configuring from resource: /
hibernate.cfg.xml
[java] 16:26:00,842 INFO Configuration:1081 - Configuration resource: /hib
ernate.cfg.xml
[java] 16:26:00,936 INFO Configuration:444 - Mapping resource: Consumer.hb
m.xml
[java] 16:26:01,045 INFO HbmBinder:260 - Mapping class: Consumer -> common
_enroll
[java] 16:26:01,061 INFO Configuration:1222 - Configured SessionFactory: n
ull
[java] 16:26:01,061 INFO Configuration:875 - processing extends queue
[java] 16:26:01,076 INFO Configuration:879 - processing collection mapping
s
[java] 16:26:01,076 INFO Configuration:888 - processing association proper
ty references
[java] 16:26:01,076 INFO Configuration:917 - processing foreign key constr
aints
[java] 16:26:01,139 INFO DriverManagerConnectionProvider:41 - Using Hibern
ate built-in connection pool (not for production use!)
[java] 16:26:01,139 INFO DriverManagerConnectionProvider:42 - Hibernate co
nnection pool size: 1
[java] 16:26:01,139 INFO DriverManagerConnectionProvider:45 - autocommit m
ode: false
[java] 16:26:01,217 INFO DriverManagerConnectionProvider:80 - using driver
: COM.ibm.db2.jdbc.app.DB2Driver at URL: jdbc:db2:BHFFDB
[java] 16:26:01,217 INFO DriverManagerConnectionProvider:86 - connection p
roperties: {user=bh00ff, password=****}
[java] 16:26:05,967 INFO SettingsFactory:77 - RDBMS: DB2/6000, version: 08
.01.0006
[java] Initial SessionFactory creation failed.java.lang.AbstractMethodError
: COM.ibm.db2.jdbc.app.DB2DatabaseMetaData.supportsResultSetType(I)Z
[java] 16:26:05,967 INFO SettingsFactory:78 - JDBC driver: IBM DB2 JDBC 1.
2 Type 2, version: 07.02.0000
[java] java.lang.ExceptionInInitializerError
[java] at HibernateUtil.<clinit>(Unknown Source)
[java] at EventManager.listEvents(Unknown Source)
[java] at EventManager.main(Unknown Source)
[java] Caused by: java.lang.AbstractMethodError: COM.ibm.db2.jdbc.app.DB2Da
tabaseMetaData.supportsResultSetType(I)Z
[java] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFacto
ry.java:80)
[java] at org.hibernate.cfg.Configuration.buildSettings(Configuration.j
ava:1463)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configura
tion.java:1004)
[java] ... 3 more
[java] Exception in thread "main"
[java] Java Result: 1

BUILD SUCCESSFUL
Total time: 7 seconds


Please help


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 23, 2005 7:33 am 
Newbie

Joined: Fri Sep 23, 2005 6:46 am
Posts: 12
I got the solution from here>
http://forums.hibernate.org/viewtopic.p ... 175109a7b8

Thanks all!

Quoted from mapofe >

Hi, I think you are using the wrong driver package.
If your are running windows and JDK >= 1.2, you should run (in the db2 directory) SQLLIB/java12/usejdbc12.bat -> it will generate the right db2java.zip in the SQLLIB/java directory.
Regards
Massimo


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

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.