Manual
the connection URL, specify the connection URL as jdbc:sqlmx:// for the SQL/MX database
in the jdbc.properties file:
jdbc.properties file:
jdbc.url=jdbc:sqlmx://
Establishing the Connection
Specify the username and password with no values in the jdbc.properties file:
jdbc.username=
jdbc.password=
Configurations in the applicationContext.xml File
For making necessary JDBC configurations, complete the following activities:
1. Defining the placeholder for JDBC Type 2 Driver Class
2. Defining the Placeholder for Connection URL
3. Defining the Placeholder for Establishing the Connection
4. Wiring of JDBC Properties
Defining the placeholder for JDBC Type 2 Driver Class
Modify the applicationContext.xml file to define a placeholder for the JDBC Type 2 driver
class name com.tandem.sqlmx.SQLMXDriver from the jdbc.properties file as shown
below.
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClassName">
<value>${jdbc.driver}</value>
</property>
NOTE: It is recommended to use com.mchange.v2.c3p0.ComboPooledDataSource as
the datasource class because it provides various parameters for connection pooling. In case you
do not use connection pooling, you can either use
org.apache.commons.dbcp.BasicDataSource provided by Apache DBCP or
org.springframework.jdbc.datasource.DriverManagerDataSource provided by
the Spring framework.
Defining the Placeholder for Connection URL
Modify the applicationContext.xml file to define a placeholder for the connection URL
from the jdbc.properties file as shown below.
<property name="url">
<value>${jdbc.url}</value>
</property>
Defining the Placeholder for Establishing the Connection
To establish the database connection, modify the applicationContext.xml file to define a
placeholder for the username and password from the jdbc.properties file as shown below.
<property name="username">
<value>${jdbc.user}</value>
</property>
<property name="password">
<value>${jdbc.password}</value>
</property>
Wiring of JDBC Properties
After all the database properties are set, wire the jdbc.properties file in the
applicationContext.xml file so that the actual values are available during runtime. The
Spring Framework Configurations 77