1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

Spring interview questions

!!! Spring interview questions !!!

How to integrate Spring with Hibernate ?

There are two steps
step 1.
In the bean.xml which is realted to bean factory spring.
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<property name="url">
<property name="username">
<property name="password">
<bean id="factory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingResources">
<property name="hibernateProperties">
<prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<property name="dataSource">
<ref bean="dataSource"/>
<bean id="eventDao" class="EventSpringDao">
<property name="sessionFactory">
<ref bean="factory" />

EventSpringDao class has setter and getter method of sessionFactory.

Step 2.

In the EventSpringDao class you can do getSessionFactory().openSession() to access data base.

your class you can extend HibernateDaoSupport.
public EventSpringDao extends HibernateDaoSupport{
public void saveOrUpdate(Event event){


Reviews and Comments

PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2019

About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy