Bookmark Topic Watch Topic
  • New Topic

DBCP datasource with Hibernate, help me?  RSS feed

Mallik Avula
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi friends
i developed a sample application with struts(i learned struts with great help of this group,i thankful to all).
To that i use apache DBCP to create DataSource

code snippet of struts-config.xml
<data-source type="org.apache.tomcat.dbcp.dbcp.BasicDataSource">
<set-property property="password" value="aims"/>
<set-property property="username" value="aims"/>
<set-property property="url" value="jdbc racle:thin:@"/>
<set-property property="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>

now i want to use( you can call plugin) hibernate to my struts sample application and i wish DBCP only for data source(i read it is better than C3PO).

help me how to configure datasource for hibernate with DBCP,
i wrote hibernate.cfg.xml like this
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"

<!-- Database connection settings -->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc racle:thin:@</property>
<property name="connection.username">aims</property>
<property name="connection.password">aims</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.provider_class">org.apache.tomcat.dbcp.dbcp.BasicDataSource</property>
<property name="Dbcp.minPoolSize">5</property>
<property name="Dbcp.timeout">500</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="">update</property>
<mapping resource="contact.hbm.xml"/>

it is giving the error:
Could not instantiate connection provider: org.apache.tomcat.dbcp.dbcp.BasicDataSource

help me. how to configure and where to configure
any help greatly cherished
Mark Spritzler
Posts: 17309
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Mallik, please do not duplicate post. You have already asked this question.

I am closing this thread..

    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!