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

Page 65: Establishing the connection, Configurations in the applicationcontext.xml file

Advertising
background image

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” (page 65)

2.

“Configurations in the applicationContext.xml File” (page 65)

NOTE:

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

in the

“Installing the Spring Framework” (page 36)

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” (page 65)

2.

“Defining the Connection URL” (page 65)

3.

“Establishing the Connection” (page 65)

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:

jdbc.username=<HP NonStop Username>
jdbc.password=<HP NonStop Password>

Configurations in the applicationContext.xml File

For making necessary JDBC configurations, you need to create the applicationContext.xml
file and complete the following activities:

1.

“Defining the Placeholder for JDBC Type 4 Driver Class” (page 65)

2.

“Defining the Placeholder for Connection URL” (page 66)

3.

“Defining the Placeholder for Establishing the Connection” (page 66)

4.

“Wiring of JDBC Properties” (page 66)

Defining the Placeholder for JDBC Type 4 Driver Class

Modify the applicationContext.xml file to define a placeholder for the JDBC Type 4 driver
class name com.tandem.t4jdbc.SQLMXDriver from the jdbc.properties file as shown
below.

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClassName">

Spring Framework Configurations

65

Advertising
This manual is related to the following products: