Hibernate version: 3.1.2
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "C:/sf/hibernate/hibernatesample/WebContent/WEB-INF/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.sf.hibernate.Employee" table="EMPLOYEE">
<id name="empNo" type="string" column="EMPNO">
<generator class="seqhilo">
<param name="sequence">empseq</param>
<param name="max_lo">100</param>
</generator>
</id>
<!-- A cat has to have a name, but it shouldn' be too long. -->
<property name="firstNme">
<column name="FIRSTNME" />
</property>
<property name="lastName">
<column name="LASTNAME" />
</property>
</class>
</hibernate-mapping>
****************Hibernate config**************
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "C:/sf/hibernate/hibernatesample/WebContent/WEB-INF/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">COM.ibm.db2.jdbc.app.DB2Driver</property>
<property name="hibernate.connection.url">jdbc:db2:SAMPLE</property>
<property name="hibernate.connection.username">svpa</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="hibernate.hbm2ddl.auto">validate</property>
<!-- Mapping files -->
<mapping resource="employee.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
SessionFactory sf = new Configuration().configure().buildSessionFactory();
Session s = sf.openSession();
List list = s.createSQLQuery("SELECT firstName, lastName empNO from EMPOYEE").addEntity(Employee.class).list();
System.out.println("Test");
Full stack trace of any exception that occurs:
0 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.1.2
10 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
10 [main] INFO org.hibernate.cfg.Environment - using CGLIB reflection optimizer
10 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
130 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
130 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
331 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.driver_class=COM.ibm.db2.jdbc.app.DB2Driver
331 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.url=jdbc:db2:SAMPLE
331 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.username=svpa
331 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.password=ANil85in
331 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.connection.pool_size=10
331 [main] DEBUG org.hibernate.cfg.Configuration - show_sql=true
331 [main] DEBUG org.hibernate.cfg.Configuration - dialect=org.hibernate.dialect.DB2Dialect
331 [main] DEBUG org.hibernate.cfg.Configuration - hibernate.hbm2ddl.auto=validate
331 [main] DEBUG org.hibernate.cfg.Configuration - null<-org.dom4j.tree.DefaultAttribute@2c78538 [Attribute: name resource value "employee.hbm.xml"]
331 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource: employee.hbm.xml
601 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.sf.hibernate.Employee -> EMPLOYEE
611 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: empNo -> EMPNO
641 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: firstNme -> FIRSTNME
641 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: lastName -> LASTNAME
641 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
641 [main] DEBUG org.hibernate.cfg.Configuration - properties: {java.assistive=ON, hibernate.connection.password=ANil85in, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\bin, java.vm.version=1.4.1, hibernate.connection.username=svpa, java.vm.vendor=IBM Corporation, java.vendor.url=http://www.ibm.com/, path.separator=;, java.vm.name=Classic VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\sf\hibernate3\TestHibernateWeb, java.runtime.version=1.4.1, java.fullversion=J2RE 1.4.1 IBM Windows 32 build cn1411-20031011 (JIT enabled: jitc), java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\TEMP\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, java.awt.fonts=, os.name=Windows XP, sun.java2d.fontpath=, java.library.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\bin;.;C:\WINNT\system32;C:\WINNT;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin;C:\PROGRA~1\ORA920\bin;C:\PROGRA~1\ORA920\jre\1.4.2\bin\client;C:\PROGRA~1\ORA920\jre\1.4.2\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\PROGRAM FILES\THINKPAD\UTILITIES;C:\WINNT\system32;C:\WINNT;C:\Progra~1\Serena\CHANGE~1\DIMENS~1\9.1\PROG;c:\progra~1\Merant\DIMENS~1\8.0\PROG;C:\Program Files\Host Integration Server\system;C:\WINNT\System32\Wbem;%PRODDIR%\ISS;C:\PROD\ISS;C:\PROGRAM FILES\RUMBA\SYSTEM;C:\PROGRA~1\DB2\SQLLIB\BIN;C:\PROGRA~1\DB2\SQLLIB\FUNCTION;C:\DOCUMENTS AND SETTINGS\ALL USERS\APPLICATION DATA\NOTES;C:\PROGRAM FILES\NOTES;C:\PROGRA~1\DB2\SQLLIB\SAMPLES\REPL;C:\Program Files\VSEW310;C:\Program Files\VSEW310\Lib;C:\Program Files\VSEW310\qelib;C:\PROD\WSD\SMSNomad\;C:\Program Files\FileNET\IDM;C:\Program Files\Rumba\;C:\Program Files\Protocom\SecureLogin\;gram Files\Protocom\SecureLogin;C:\PROD\WSD\SMSNomad;C:\Program Files\HEWLETT-PACKARD\CLIENT\bin;C:\Program Files\InstallShield\AdminStudio\6.0\ConflictSolver;%PATH%;C:\Program Files\VS60\Common\Tools\WinNT;C:\Program Files\VS60\Common\MSDev98\Bin;C:\Program Files\VS60\Common\Tools;C:\Program Files\VS60\VC98\bin;C:\PROGRA~1\NETMAN~1\NETMAN~1\COMMON, java.specification.name=Java Platform API Specification, java.class.version=48.0, hibernate.connection.pool_size=10, ibm.system.encoding=Cp1252, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, invokedviajava=, os.version=5.1, user.home=C:\Documents and Settings\svpa, user.timezone=, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, hibernate.connection.driver_class=COM.ibm.db2.jdbc.app.DB2Driver, show_sql=true, java.class.path=C:\sf\hibernate3\TestHibernateWeb\WebContent\WEB-INF\classes;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\java\jre\lib\rt.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\j2ee.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\servletevent.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\ivjejb35.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\runtime.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ant-1.6.5.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ant-antlr-1.6.5.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ant-junit-1.6.5.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ant-launcher-1.6.5.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\antlr-2.7.6rc1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ant-swing-1.6.5.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\asm.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\asm-attrs.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\c3p0-0.9.0.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\cglib-2.1.3.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\cleanimports.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\commons-collections-2.1.1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\commons-logging-1.0.4.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\concurrent-1.3.2.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\connector.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\dom4j-1.6.1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ehcache-1.1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jaas.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jacc-1_0-fr.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jaxen-1.1-beta-7.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jboss-cache.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jboss-common.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jboss-jmx.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jboss-system.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jdbc2_0-stdext.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jgroups-2.2.8.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jta.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\junit-3.8.1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\log4j-1.2.11.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\oscache-2.1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\proxool-0.8.3.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\swarmcache-1.0rc2.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\syndiag2.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\versioncheck.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\xerces-2.6.2.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\xml-apis.jar;C:\Program Files\DB2\SQLLIB\java\db2java.zip;C:\Program Files\DB2\SQLLIB\java\db2jcc.jar;C:\Program Files\DB2\SQLLIB\java\db2jcc_license_cu.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\hibernate3.jar, user.name=svpa, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.DB2Dialect, hibernate.connection.url=jdbc:db2:SAMPLE, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=J2RE 1.4.1 IBM Windows 32 build cn1411-20031011 (JIT enabled: jitc), java.version=1.4.1, java.ext.dirs=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\ext, sun.boot.class.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\core.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\graphics.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\security.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\server.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\xml.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\charsets.jar, java.vendor=IBM Corporation, file.separator=\, hibernate.hbm2ddl.auto=validate, java.vendor.url.bug=, java.compiler=jitc, sun.io.unicode.encoding=UnicodeLittle, dialect=org.hibernate.dialect.DB2Dialect}
841 [main] DEBUG org.hibernate.cfg.Configuration - Preparing to build session factory with filters : {}
841 [main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
841 [main] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
841 [main] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
841 [main] DEBUG org.hibernate.cfg.Configuration - processing association property references
841 [main] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints
992 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
992 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 10
992 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
1112 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: COM.ibm.db2.jdbc.app.DB2Driver at URL: jdbc:db2:SAMPLE
1112 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=svpa, password=ANil85in}
1112 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
1112 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - opening new JDBC connection
1563 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - created connection to: jdbc:db2:SAMPLE, Isolation Level: 2
1573 [main] DEBUG org.hibernate.cfg.SettingsFactory - could not get database version from JDBC metadata
1573 [main] INFO org.hibernate.cfg.SettingsFactory - RDBMS: DB2/NT, version: 08.01.0003
1573 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: IBM DB2 JDBC 2.0 Type 2, version: 08.01.0003
1573 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
1603 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.DB2Dialect
1623 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
1623 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
1623 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
1623 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
1623 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
1623 [main] DEBUG org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled
1623 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
1623 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
1623 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
1623 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
1623 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
1623 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
1633 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
1633 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
1633 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
1633 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
1633 [main] INFO org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.EhCacheProvider
1633 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
1633 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
1633 [main] DEBUG org.hibernate.exception.SQLExceptionConverterFactory - Using dialect defined converter
1643 [main] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
1643 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
1643 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
1643 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
1833 [main] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
1833 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Session factory constructed with filter configurations : {}
1833 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiating session factory with properties: {java.assistive=ON, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.connection.password=ANil85in, sun.boot.library.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\bin, java.vm.version=1.4.1, hibernate.connection.username=svpa, java.vm.vendor=IBM Corporation, java.vendor.url=http://www.ibm.com/, path.separator=;, java.vm.name=Classic VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\sf\hibernate3\TestHibernateWeb, java.runtime.version=1.4.1, java.fullversion=J2RE 1.4.1 IBM Windows 32 build cn1411-20031011 (JIT enabled: jitc), java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\TEMP\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, java.awt.fonts=, os.name=Windows XP, sun.java2d.fontpath=, java.library.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\bin;.;C:\WINNT\system32;C:\WINNT;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin;C:\PROGRA~1\ORA920\bin;C:\PROGRA~1\ORA920\jre\1.4.2\bin\client;C:\PROGRA~1\ORA920\jre\1.4.2\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\PROGRAM FILES\THINKPAD\UTILITIES;C:\WINNT\system32;C:\WINNT;C:\Progra~1\Serena\CHANGE~1\DIMENS~1\9.1\PROG;c:\progra~1\Merant\DIMENS~1\8.0\PROG;C:\Program Files\Host Integration Server\system;C:\WINNT\System32\Wbem;%PRODDIR%\ISS;C:\PROD\ISS;C:\PROGRAM FILES\RUMBA\SYSTEM;C:\PROGRA~1\DB2\SQLLIB\BIN;C:\PROGRA~1\DB2\SQLLIB\FUNCTION;C:\DOCUMENTS AND SETTINGS\ALL USERS\APPLICATION DATA\NOTES;C:\PROGRAM FILES\NOTES;C:\PROGRA~1\DB2\SQLLIB\SAMPLES\REPL;C:\Program Files\VSEW310;C:\Program Files\VSEW310\Lib;C:\Program Files\VSEW310\qelib;C:\PROD\WSD\SMSNomad\;C:\Program Files\FileNET\IDM;C:\Program Files\Rumba\;C:\Program Files\Protocom\SecureLogin\;gram Files\Protocom\SecureLogin;C:\PROD\WSD\SMSNomad;C:\Program Files\HEWLETT-PACKARD\CLIENT\bin;C:\Program Files\InstallShield\AdminStudio\6.0\ConflictSolver;%PATH%;C:\Program Files\VS60\Common\Tools\WinNT;C:\Program Files\VS60\Common\MSDev98\Bin;C:\Program Files\VS60\Common\Tools;C:\Program Files\VS60\VC98\bin;C:\PROGRA~1\NETMAN~1\NETMAN~1\COMMON, java.specification.name=Java Platform API Specification, java.class.version=48.0, hibernate.connection.pool_size=10, ibm.system.encoding=Cp1252, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, invokedviajava=, os.version=5.1, user.home=C:\Documents and Settings\svpa, user.timezone=, java.awt.printerjob=sun.awt.windows.WPrinterJob, java.specification.version=1.4, file.encoding=Cp1252, hibernate.connection.driver_class=COM.ibm.db2.jdbc.app.DB2Driver, show_sql=true, user.name=svpa, java.class.path=C:\sf\hibernate3\TestHibernateWeb\WebContent\WEB-INF\classes;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\java\jre\lib\rt.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\j2ee.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\servletevent.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\ivjejb35.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\runtime.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ant-1.6.5.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ant-antlr-1.6.5.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ant-junit-1.6.5.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ant-launcher-1.6.5.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\antlr-2.7.6rc1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ant-swing-1.6.5.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\asm.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\asm-attrs.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\c3p0-0.9.0.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\cglib-2.1.3.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\cleanimports.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\commons-collections-2.1.1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\commons-logging-1.0.4.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\concurrent-1.3.2.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\connector.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\dom4j-1.6.1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\ehcache-1.1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jaas.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jacc-1_0-fr.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jaxen-1.1-beta-7.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jboss-cache.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jboss-common.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jboss-jmx.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jboss-system.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jdbc2_0-stdext.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jgroups-2.2.8.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\jta.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\junit-3.8.1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\log4j-1.2.11.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\oscache-2.1.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\proxool-0.8.3.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\swarmcache-1.0rc2.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\syndiag2.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\versioncheck.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\xerces-2.6.2.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\lib\xml-apis.jar;C:\Program Files\DB2\SQLLIB\java\db2java.zip;C:\Program Files\DB2\SQLLIB\java\db2jcc.jar;C:\Program Files\DB2\SQLLIB\java\db2jcc_license_cu.jar;C:\Documents and Settings\svpa\Desktop\harinder\hibernate3\hibernate312\hibernate-3.1\hibernate3.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre, hibernate.connection.url=jdbc:db2:SAMPLE, hibernate.dialect=org.hibernate.dialect.DB2Dialect, java.specification.vendor=Sun Microsystems Inc., user.language=en, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=J2RE 1.4.1 IBM Windows 32 build cn1411-20031011 (JIT enabled: jitc), hibernate.cglib.use_reflection_optimizer=true, java.version=1.4.1, java.ext.dirs=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\ext, sun.boot.class.path=C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\core.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\graphics.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\security.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\server.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\xml.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre\lib\charsets.jar, java.vendor=IBM Corporation, file.separator=\, java.vendor.url.bug=, hibernate.hbm2ddl.auto=validate, java.compiler=jitc, sun.io.unicode.encoding=UnicodeLittle, dialect=org.hibernate.dialect.DB2Dialect}
1863 [main] DEBUG net.sf.ehcache.CacheManager - Creating new CacheManager with default config
1873 [main] DEBUG net.sf.ehcache.CacheManager - Configuring ehcache from classpath.
1933 [main] WARN net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Documents%20and%20Settings/svpa/Desktop/harinder/hibernate3/hibernate312/hibernate-3.1/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
1953 [main] DEBUG net.sf.ehcache.config.Configuration$DiskStore - Disk Store Path: C:\TEMP\
2474 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: com.sf.hibernate.Employee
2474 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Version select: select EMPNO from EMPLOYEE where EMPNO =?
2474 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select employee_.EMPNO, employee_.FIRSTNME as FIRSTNME0_, employee_.LASTNAME as LASTNAME0_ from EMPLOYEE employee_ where employee_.EMPNO=?
2474 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into EMPLOYEE (FIRSTNME, LASTNAME, EMPNO) values (?, ?, ?)
2474 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update EMPLOYEE set FIRSTNME=?, LASTNAME=? where EMPNO=?
2474 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from EMPLOYEE where EMPNO=?
2504 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity com.sf.hibernate.Employee: select employee0_.EMPNO as EMPNO0_0_, employee0_.FIRSTNME as FIRSTNME0_0_, employee0_.LASTNAME as LASTNAME0_0_ from EMPLOYEE employee0_ where employee0_.EMPNO=?
2504 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity com.sf.hibernate.Employee: select employee0_.EMPNO as EMPNO0_0_, employee0_.FIRSTNME as FIRSTNME0_0_, employee0_.LASTNAME as LASTNAME0_0_ from EMPLOYEE employee0_ where employee0_.EMPNO=?
2504 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity com.sf.hibernate.Employee: select employee0_.EMPNO as EMPNO0_0_, employee0_.FIRSTNME as FIRSTNME0_0_, employee0_.LASTNAME as LASTNAME0_0_ from EMPLOYEE employee0_ where employee0_.EMPNO=? for read only with rs
2504 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity com.sf.hibernate.Employee: select employee0_.EMPNO as EMPNO0_0_, employee0_.FIRSTNME as FIRSTNME0_0_, employee0_.LASTNAME as LASTNAME0_0_ from EMPLOYEE employee0_ where employee0_.EMPNO=? for read only with rs
2524 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity com.sf.hibernate.Employee: select employee0_.EMPNO as EMPNO0_0_, employee0_.FIRSTNME as FIRSTNME0_0_, employee0_.LASTNAME as LASTNAME0_0_ from EMPLOYEE employee0_ where employee0_.EMPNO=?
2524 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity com.sf.hibernate.Employee: select employee0_.EMPNO as EMPNO0_0_, employee0_.FIRSTNME as FIRSTNME0_0_, employee0_.LASTNAME as LASTNAME0_0_ from EMPLOYEE employee0_ where employee0_.EMPNO=?
2524 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
2534 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - registered: 8aa3f75709c14a4c0109c14a4ef50000 (unnamed)
2534 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
2534 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiated session factory
2534 [main] INFO org.hibernate.tool.hbm2ddl.SchemaValidator - Running schema validator
2534 [main] INFO org.hibernate.tool.hbm2ddl.SchemaValidator - fetching database metadata
2534 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
2534 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - using pooled JDBC connection, pool size: 0
2534 [main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
2534 [main] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
2534 [main] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
2534 [main] DEBUG org.hibernate.cfg.Configuration - processing association property references
2534 [main] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints
2875 [main] INFO org.hibernate.tool.hbm2ddl.TableMetadata - table found: SVPA.EMPLOYEE
2875 [main] INFO org.hibernate.tool.hbm2ddl.TableMetadata - columns: [sex, lastname, firstnme, edlevel, workdept, job, midinit, phoneno, bonus, hiredate, comm, birthdate, salary, empno]
2875 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaValidator - Error closing connection
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0116E Invalid transaction state. SQLSTATE=25000
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Connection.close2(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Connection.close(Unknown Source)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:125)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:296)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at com.sf.hibernate.MainClass.main(MainClass.java:26)
org.hibernate.HibernateException: Wrong column type: EMPNO, expected: varchar(255)
at org.hibernate.mapping.Table.validateColumns(Table.java:219)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:965)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:296)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at com.sf.hibernate.MainClass.main(MainClass.java:26)
Name and version of the database you are using:
DB2 Version 8.2
Test is on Websphere- WSAD 512
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=debug, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
log4j.logger.org.apache.commons.digester=INFO
|