Configuring jdbc type 4 driver for sql/mx database, Configurations in the jdbc.properties file, Defining the connection url – HP Integrity NonStop H-Series User Manual

Page 78: Establishing the connection, Configurations in the, Jdbc.properties, File

Advertising
background image

PropertyPlaceholderConfigurer

class provided by the Spring framework substitutes all

the database properties specified in the

applicationContext.xml

file with the values specified

in the

jdbc.properties

file during runtime.

Modify the

applicationContext.xml

file for wiring the

jdbc.properties

file as shown

below:

<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
</list>
</property>
</bean>
</beans>

NOTE:

For information on the complete configuration snippet of the

applicationContext.xml

file and the

jdbc.properties

file for JDBC Type 2 driver, see

JDBC Configuration

.

Configuring JDBC Type 4 Driver for SQL/MX Database

To configure JDBC Type 4 driver for connecting a Spring application with SQL/MX database,
complete the following configurations:

1.

Configurations in the

jdbc.properties

File

2.

Configurations in the

applicationContext.xml

File

NOTE:

Verify and install JDBC Type 4 driver version T1249V11 by following the steps discussed

in the

Installing Spring Framework

chapter.

Configurations in the

jdbc.properties

File

For making necessary JDBC configurations, you need to create the

jdbc.properties

file and

complete the following activities:

1.

Defining JDBC Type 4 Driver Class for SQL/MX Database

2.

Defining the Connection URL

3.

Establishing the Connection

Defining JDBC Type 4 Driver Class for SQL/MX Database

To set the JDBC Type 4 driver, specify the JDBC Type 4 driver class

com.tandem.t4jdbc.SQLMXDriver

for the SQL/MX database in the

jdbc.properties

file:

jdbc.driverClassName=com.tandem.t4jdbc.SQLMXDriver

Defining the Connection URL

After you have set the JDBC Type 4 driver, specify the location of the SQL/MX server. URLs
referring to SQL/MX use the

jdbc: protocol

and have the server host and port number

embedded within the URL. To define the connection URL:

Specify the connection URL as

jdbc:t4sqlmx://<HP NonStop System IP Address>:<Port No.>

for the SQL/MX database in the

jdbc.properties

file as:

jdbc.url=jdbc:t4sqlmx://<HP NonStop System IP Address>:<Port No.>

Establishing the Connection

To establish connection, specify the username and password of your NonStop system in the

jdbc.properties

file:

78

Configuring Spring Applications on NonStop Systems

Advertising
This manual is related to the following products: