Creating the jdbc.properties file – HP Integrity NonStop J-Series User Manual

Page 107

Advertising
background image

<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
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">

<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
>
<property name="driverClassName">
<value>${jdbc.driver}</value>
</property>
<property name="url">
<value>${jdbc.url}</value>
</property>
<property name="username">
<value>${jdbc.user}</value>
</property>
<property name="password">
<value>${jdbc.password}</value>
</property>
<property name="connectionProperties">
<props>
<prop key="catalog">
${jdbc.catalog}
</prop>
<prop key="schema">
${jdbc.schema}
</prop>
</props>
</property>
</bean>
<bean id="empdao" class="com.hp.empinfo.service.EmployeeDao">
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations" value="/WEB-INF/jdbc.properties"/>
</bean>
</beans>

Creating the jdbc.properties File

The JdbcDaoSupport feature of Spring framework is used for connecting to the NonStop SQL/MX
database and for carrying out requested database transactions. To fulfill this requirement, the
jdbc.properties

file must be created to include all the database related information.

To create the jdbc.properties file, complete the following steps:
1.

On the Project Explorer frame, right-click EmpInfo and select New > File.

The New File dialog box appears.

2.

In the File name field, type jdbc.properties and ensure that the parent folder is set to the
EmpInfo/WebContent/WEB-INF

directory. Click Finish.

Overview of EmpInfo 107

Advertising
This manual is related to the following products: