Item.xml, Dataaccesscontext-local.xml, Item.xml dataaccesscontext-local.xml – HP Integrity NonStop H-Series User Manual

Page 158

Advertising
background image

<property name="jdbct4.root" value="<JDBC T4 installation directory>”/>

3.

The path of the JDBC/MX Type 4 driver (

t4sqlmx.jar

) was set.

A new <

fileset

> tag was added to specify the path of the JDBC/MX Type 4 driver location

under the <

copy

> tag:

<copy todir="${weblib.dir}" preservelastmodified="true">
<fileset dir="${jdbct4.root}/lib">
<include name="t4sqlmx.jar"/>
</fileset>
….
….
</copy>

4.

The path of the Commons DBCP

JAR

file (

commons-dbcp.jar

) was set.

A new <

fileset

> tag was added to specify the path of the Commons DBCP JAR file location

under the <

path

> tag:

<path id="master-classpath">
<fileset dir="${spring.root}/lib/jakarta-commons">
<include name="commons-dbcp.jar"/>
</fileset>
….
….
</path>

Item.xml

(<Spring Home>\jpetstore\src\org\springframework\samples\jpetstore\dao\
ibatis\Item.xml)

This is the ibatis mapping file to automate the mapping between database tables and Java objects.
The mappings are decoupled from the application logic by packaging the SQL statements in
XML configuration files.
In

Ibatis

, 'as value' is used to select a single primitive value from the database. 'value’ being

a keyword in SQL/MX database, 'as value' could not be used and hence

Item.xml

was modified.

Changes to the

Item.xml

file

Before the change:

<select id="getInventoryQuantity" resultclass="java.lang.integer”>
select qty as value from inventory where itemid = #value#
</select>

After the change:

<resultMap id="result-for-quantity" class="java.lang.Integer">
<result property="qty" column="qty" />
</resultMap>
<select id="getInventoryQuantity" resultMap="result-for-quantity">
select qty from inventory where itemid = #value#
</select>

dataAccessContext-local.xml

(<Spring Home>\jpetstore\war\WEB-INF\dataAccessContext-local.xml):

The

dataAccessContext-local.xml

file contains all the configuration metadata for JPetStore.

The bean with the dataSource ID in the

dataAccessContext-local.xml

file was modified

to use the customized

SetDatabase

class instead of the

BasicDataSource

class.

Changes to the

dataAccessContext-local.xml

file

Before the change:

158

Customizing Sample Applications

Advertising
This manual is related to the following products: