Topic
1 reply Latest Post - ‏2012-01-17T17:16:16Z by SystemAdmin
SystemAdmin
SystemAdmin
162 Posts
ACCEPTED ANSWER

Pinned topic JDBC Connection error in hibernate based web app on WAS

‏2009-06-08T02:36:58Z |
Hi,

I am trying to run a hibernate based web app in WAS6.1. When trying to do any database activity from within code , it is throwing the following error

java.lang.UnsupportedOperationException:The user must provide a JDBC Connection.

The application database configuration is stored in hibernate.cfg.xml file which
is located in source directory (and hence after build gets placed in applcation's WEB-INF/classes directory).

Follwing is a snapshot of this file

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.connection.url">jdbc:db2://localhost:50000/dbname</property>
<property name="hibernate.connection.username">db2admin</property>
<property name="hibernate.connection.password">db2admin</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.DB2Dialect</property>
<property name="hibernate.hbm2ddl.auto">create-drop</property>
<!-- Mapping files -->
<mapping resource="cd.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Please help in getting around this problem
Updated on 2012-01-17T17:16:16Z at 2012-01-17T17:16:16Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    162 Posts
    ACCEPTED ANSWER

    Re: JDBC Connection error in hibernate based web app on WAS

    ‏2012-01-17T17:16:16Z  in response to SystemAdmin
    Is the DB2 database instance running?