Integrating NonStop JDBC Type 4 Driver With JBoss Applications
interfaces), and extra jars and JSP tag library descriptors required by the Web application (the struts
files in this example). The command to build the Web client WAR file is as follows:
ant -f jboss-build.xml package-web
Packaging the Java client
In addition to the Web interface, there is a standalone Java client for administering customers and
accounts. You can build it using the following command:
ant -f jboss-build.xml package-client
It contains the application-client.xml and jboss-client.xml descriptors as well as the client
jndi.properties file. The client jar will also be included as an additional module in the Enterprise
Archive (EAR) file and the server.
Assembling the EAR file
The EAR file is the complete application, containing the three EJB modules and the Web module. It
must also contain an additional descriptor called application.xml. It is also possible to deploy EJB and
Web application modules individually, but the EAR file provides a convenient single unit:
ant -f jboss-build.xml assemble-app
This should produce the final file JBossDukesBank.ear.
Setting up the database
Before you can deploy the application, you need a viable database for it to run against. If you are
writing an application that uses container-managed EJB persistence, you can configure the engine to
create the tables for you at deployment; otherwise, you must have a set of scripts to do the task. This
is also a convenient way of pre-populating the database with data.
The J2EE Software Development Kit (SDK) comes with the Cloudscape database, which is used
throughout the tutorials. You will be using the NonStop SQL/MX Database that is running on the
NonStop system.
You must complete a few tasks before you can successfully test your application:
• Create and populate the NonStop SQL/MX Database with the appropriate tables and values
• Start the HP NonStop ODBC/MX Service on the NonStop system
• Choose the JBoss Application Server to use the JDBC Type 4 Driver to connect to the NonStop
SQL/MX Database
• Make the JDBC Type 4 Driver jar file available in the JBoss environment
Populating the NonStop SQL/MX Database
Supplementing this document is a zip file named NonStopFiles_JBoss.zip. One of the files in this
archive, named dukesDB.sh, contains the script file to create and populate the necessary database on
NonStop SQL/MX Software. Unpack the archive file and transfer dukesDB.sh (in ASCII mode) to the
HP Open System Services (OSS) environment.
To set up the NonStop SQL/MX Database, change to the directory on OSS where the dukesDB.sh is
located and run the following command:
OSS> ./dukesDB.sh
This creates the database in the schema DUKECAT.DUKESCHEMA.
5