Modifying the applicationcontext.xml file – HP Integrity NonStop J-Series User Manual
Page 240
Modifying the EmpInfo application involves the following tasks:
•
“Modifying the applicationContext.xml File” (page 240)
•
“Modifying the EmployeeDao.java File” (page 241)
•
“Creating the Employee.hbm.xml File” (page 242)
•
“Removing the EmployeeRowMapper.java File” (page 245)
•
“Adding Dependency JAR Files” (page 246)
Modifying the applicationContext.xml File
Modify the EmpInfo/WebContent/WEB-INF/applicationContext.xml file, so that it uses
the Hibernate SessionFactory to connect to the employee SQL/MX database table using the
following steps:
1.
Specify the SessionFactory in the applicationContext.xml file as shown:
org.hibernate.dialect.SqlmxDialect
Example of Integrating Hibernate into Spring 9
2.
Modify the bean instance of the EmployeeDao class to add the reference of the Hibernate
SessionFactory, as shown:
After modification, the applicationContext.xml file should appear as:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
240 Integrating Frameworks