-
Apr 29th, 2010, 12:31 PM
#1
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">
OR
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
OR
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
Thanks
Scott
-
Apr 29th, 2010, 07:33 PM
#2
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
#3
Jars needed for Spring Hibernate Integration
What are the Jar Files needed for Spring Hibernate Integration? And where to download, if any?
Thanks
Scott
-
May 3rd, 2010, 01:59 AM
#4
Hibernate - Spring
Hello,
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 -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
<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" />
</bean>
of course you give your own parameters for database name as well as username & password.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules