beautypg.com

Installing the driver as a module, Configuring the datasource – HP Integrity NonStop H-Series User Manual

Page 66

background image

1.

Define the dependencies in the META-INF/MANIFEST.MF class of the driver. This can be
done by adding a Dependencies: in the manifest file
of the driver.

NOTE:

Here module refers to an NSASJ module that contains the dependency jars.

Making this entry in the manifest file of the driver jar might have undesirable side effects when
the driver jar is used in any other Application Server, or a managed environment. Since, the
driver provided by SQL/MX is a signed jar, making any modifications to the manifest file
invalidates the jar.

2.

Define a custom set of dependencies in jboss-deployment-structure.xml that can be
placed in the META-INF folder of the driver jar. When the Application Server notices this file
in the META-INF folder of the jar, it makes all the dependencies available. This is the strategy
used by NSASJ to add dependencies to the JDBC jar.

The add_services.sh script makes all the necessary modifications to the driver jar file.

Installing the driver as a module

Although the JBoss related documents

https://community.jboss.org/wiki/

DataSourceConfigurationInAS7

explain that the driver can be deployed as a module, but there

are certain drawbacks in this approach.

If the driver is defined as a module, then the DataSource using the driver needs to reference the
driver using the module name. Refer the following DataSource Configuration sample:



enabled="true" use-java-context="true" jta="true">
......
......
......
sqlmxt4




When a DataSource is defined in an application in the -ds.xml file, and the application is
deployed, the container throws an error that the element is not allowed in a standalone
-ds.xml file. Since the element is not allowed when the datasource is defined in the
-ds.xml, the JDBC drivers have to be installed as a jar deployment.

Configuring the DataSource

The DataSource can be configured either in the domain configuration file (domain.xml), or in
a *-ds.xml configuration file which is specifically meant to configure a DataSource. It is a
good practice to configure a DataSource per application using *-ds.xml so that, when the
application gets undeployed, the DataSource configured with the application also gets removed.

The schema descriptor of the DataSource element is defined in the file
jboss-as-datasources_1_1.xsd

located in the folder <NSASJ_HOME>/docs/schema.

Table 19 (page 67)

explains some elements and their attributes in the DataSource configuration

that have a special relevance to NSASJ.

66

Configuring NSASJ

This manual is related to the following products: