| Author |
Spring Hibernate Communication
|
San Nan
Greenhorn
Joined: Jul 01, 2005
Posts: 22
|
|
Dear All, I am New to Spring & wants an application source for communicating with hibernate. Please provide me the help for how to communicate Spring+Hibernate+mySql. Thanks & Regards San Nan
|
 |
Junilu Lacar
Ranch Hand
Joined: Feb 26, 2001
Posts: 3008
|
|
Let me introduce you to my little friend, Google ...
|
Junilu
[How to Ask Questions] [How to Answer Questions] [MiH]
|
 |
Jignesh Patel
Ranch Hand
Joined: Nov 03, 2001
Posts: 625
|
|
You may like to see this link: http://jdj.sys-con.com/read/140097_p.htm. Also to make your life simpler, pickup any Spring example and replace DAO object with your hibernate classes. Think hibernate integration as of adding a DAO class.
|
 |
San Nan
Greenhorn
Joined: Jul 01, 2005
Posts: 22
|
|
|
This link is not working
|
 |
Srinivasa Kadiyala
Ranch Hand
Joined: Jun 10, 2004
Posts: 237
|
|
|
Yes I too tried. The link is not working
|
Srini
|
 |
Magesh Lakshmi
Greenhorn
Joined: Nov 02, 2005
Posts: 10
|
|
|
Send me an email , if you need code samples on how to use this one.
|
Mag
|
 |
Clodoaldo J�nior
Greenhorn
Joined: Nov 12, 2005
Posts: 3
|
|
Dear San Nan, Integrate Spring framework with Hibernate and any database is very simple. You must to declare a configuration database in application configuration file as follow: <!-- Data source bean --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"> <value>org.postgresql.Driver</value></property> <property name="url"> <value>jdbc :p ostgresql://localhost/mydatabase</value></property> <property name="username"><value>bonovox</value></property> <property name="password"><value>u2forever</value></property> </bean> <!-- SessionFactory bean --!> <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean"> <property name="dataSource"><ref local="dataSource"/></property> <property name="mappingResources"> <value>product.hbm.xml</value></property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> net.sf.hibernate.dialect.PostgresSQLDialect</prop> </props> </property> </bean> After, you only use hibernateTemplate in your code to make available the CRUD operations in your applications. hibernateTemplate is obtain through class org.springframework.orm.hibernate.support.HibernateDaoSupport called method getHibernateTemplate(). []'s ClodoaldoJR [ November 12, 2005: Message edited by: Clodoaldo J�nior ] [ November 12, 2005: Message edited by: Clodoaldo J�nior ] [ November 12, 2005: Message edited by: Clodoaldo J�nior ] [ November 12, 2005: Message edited by: Clodoaldo J�nior ] [ November 12, 2005: Message edited by: Clodoaldo J�nior ]
|
UFPB - University Federal of Paraiba - Brazil (bachelor degree)
|
 |
 |
|
|
subject: Spring Hibernate Communication
|
|
|