Just begin to try to use hibernate with DB2 8.1.
Copied the db2java.zip to the place of classpath, but still
get the error message, saying driver class not found (it is
inside the zip file), what's wrong?
13:46:09,723 INFO Environment:462 - Hibernate 2.1.3
13:46:09,743 INFO Environment:496 - loaded properties from resource hibernate.properties: {hibernate.connection.username=db2admin , hibernate.connection.password=db2admin , hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=cirrus.hibernate.sql.DB2Dialect, hibernate.connection.url=jdbc:db2:empl , hibernate.connection.driver_class=COM.ibm.db2.jdbc.app.DB2Driver }
13:46:09,743 INFO Environment:519 - using CGLIB reflection optimizer
13:46:09,743 INFO Environment:530 - JVM does not support Statement.getGeneratedKeys()
13:46:09,743 INFO Environment:541 - JVM does not support LinkedHasMap, LinkedHashSet - ordered maps and sets disabled
13:46:09,743 INFO Environment:544 - using workaround for JVM bug in java.sql.Timestamp
13:46:09,773 INFO Configuration:347 - Mapping resource: com/ibm/hibernate_article/Employee.hbm.xml
13:46:11,305 INFO Binder:229 - Mapping class: com.ibm.hibernate_article.Employee -> employee
13:46:11,425 INFO Configuration:347 - Mapping resource: com/ibm/hibernate_article/Department.hbm.xml
13:46:12,056 INFO Binder:229 - Mapping class: com.ibm.hibernate_article.Department -> department
13:46:12,056 INFO Configuration:613 - processing one-to-many association mappings
13:46:12,056 INFO Configuration:622 - processing one-to-one association property references
13:46:12,056 INFO Configuration:647 - processing foreign key constraints
13:46:12,106 WARN SettingsFactory:50 - No dialect set - using GenericDialect: Dialect class not found: cirrus.hibernate.sql.DB2Dialect
13:46:12,106 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.GenericDialect
13:46:12,146 INFO SettingsFactory:62 - Use outer join fetching: false
13:46:12,146 INFO DriverManagerConnectionProvider:42 - Using Hibernate built-in connection pool (not for production use!)
13:46:12,146 INFO DriverManagerConnectionProvider:43 - Hibernate connection pool size: 20
13:46:12,156 FATAL DriverManagerConnectionProvider:62 - JDBC Driver class not found: COM.ibm.db2.jdbc.app.DB2Driver
net.sf.hibernate.HibernateException: JDBC Driver class not found: COM.ibm.db2.jdbc.app.DB2Driver
at net.sf.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:63)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:64)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at HBTest.main(HBTest.java:42)
|