Apr 29th, 2010, 12:31 PM
Spring and Hibernate
Try to set up spring to work with hibernate. Tried several examples. None of them worked. I suspect I may miss some jar files. What are the jar files for setting up:
<bean id="sessionFactory" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
Apr 29th, 2010, 07:33 PM
While spring documentation is the right place where you can find the related details, I would say that the second and third options are needed for configuring the datasource and session factory and a txmanager would also be required further for you to complete the application configuration.
Check this article out on Spring integration with Hibernate. I am sure that would help you a lot!
Apr 30th, 2010, 12:09 PM
Jars needed for Spring Hibernate Integration
What are the Jar Files needed for Spring Hibernate Integration? And where to download, if any?
May 3rd, 2010, 01:59 AM
Hibernate - Spring
If you are using spring 2.5 download spring with dependencies zip file, when you extract zip file you see several folders out of these in the library you require are in "spring2.5/lib/hibernate". This is the download link. http://www.springsource.org/download.
I did configure it, and I needed atleast hibernate3.jar, spring.jar, spring-hibernate3.jar and configuration files like hsqlbd.jar if you are using hsqldb or mysql-connector-java-5.x.jar if you are using mysql database.
Below I am showing how you can configure your datasource:
<!-- Hibernate -->
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost/mydb" />
<property name="username" value="userroot" />
<property name="password" value="userroot" />
of course you give your own parameters for database name as well as username & password.