Bookmark Topic Watch Topic
  • New Topic

DBCP datasource with Hibernate, help me?

 
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-sources>
<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:@172.23.162.200:1521:arti"/>
<set-property property="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
</data-source>
</data-sources>
------------------------------------------------

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"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>

<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc racle:thin:@172.23.162.200:1521:arti</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="hbm2ddl.auto">update</property>
<mapping resource="contact.hbm.xml"/>
</session-factory>

</hibernate-configuration>
--------------------------------------------------------------
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
Mallik
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
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..

Mark
 
    Bookmark Topic Watch Topic
  • New Topic