beautypg.com

Creating the jdbc.properties file, Creating the, Jdbc.properties – HP Integrity NonStop H-Series User Manual

Page 122: File

background image

2.

Create a new XML file in the

EmpInfo/WebContent/WEB-INF

directory and enter the

name of the XML file as

applicationContext

.

NOTE:

By default, XML files open in the XML Editor. The XML Editor has two views:

Design and Source view. Select the Source view.

3.

Modify the

applicationContext.xml

file to add a bean definition of the

EmployeeDao

class. After modification, the

applicationContext.xml

file must appear as:


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">

class="org.springframework.jdbc.datasource.DriverManagerDataSource"
destroy-method="close">

${jdbc.driver}


${jdbc.url}


${jdbc.user}


${jdbc.password}




${jdbc.catalog}


${jdbc.schema}









class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">


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, enter

jdbc.properties

and ensure that the parent folder is set to

the

EmpInfo/WebContent/WEB-INF

directory. Click Finish.

Figure 5-24

shows the New File dialog box.

122

Getting Started with Spring

This manual is related to the following products: