my coding for connection pooling is as :
<Context path="/HibernatePrj" reloadable="true" docBase="E:\Projects\HibernatePrj" workDir="E:\Projects\HiberPrj\work" >
<Resource name="jdbc/hiberprj" scope="shareable" type="javax.sql.DataSource" auth="container"/>
<ResourceParams name="jdbc/hiberprj">
<parameter><name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://192.168.10.1:3306/hibertest?autoReconnect=true</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>username</name>
<value>test</value>
</parameter>
<parameter>
<name>password</name>
<value>test</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>20</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
</ResourceParams>
</Context>
And in web.xml i put like this
<resource-ref>
<description> DB Connection pooling</description>
<res-ref-name>jdbc/hiberprj</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<servlet>
<servlet-name>pool</servlet-name>
<servlet-class>pkg.DbConTest</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>pool</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
But from other application ( in a servlet i m using same JNDI ) and it is working and showing data from databse when i execute servlet ,
However may u elaborate ur idea of DriverManagerConnectionProvider as i m new to hibernate.
max wrote:
that you are using a datasource in your hibernate.cfg.xml which for obvious reasons is not available from inside eclipse.
use a DriverManagerConnectionProvider to allow hibernate to get that connection from within hibernate