iSeries EGL

All things EGL for the iSeries / i5 / Power System

Registering JNDI Data Source Names with Tomcat

leave a comment »

Introduction

This post shows how to make JNDI-based entries into Tomcat’s context.xml file to register multiple database connection resources.

Making JNDI data source entries

The following entries where made to Tomcat’s ‘context.xml’ file for the data source names shown.


<Resource name="jdbc/MACH1" auth="Container" type="javax.sql.DataSource" maxActive="4" maxIdle="2" maxWait="10000" username="********" password="********" driverClassName="com.ibm.as400.access.AS400JDBCDriver" url="jdbc:as400:MACH1;prompt=false;naming=system;libraries=PRODLIB;transaction isolation=none;"/> <Resource name="jdbc/MACH2" auth="Container" type="javax.sql.DataSource" maxActive="4" maxIdle="2" maxWait="10000" username="********" password="********" driverClassName="com.ibm.as400.access.AS400JDBCDriver" url="jdbc:as400:MACH2;prompt=false;naming=system;libraries=DEVLIB;transaction isolation=none;"/>

*NOTE* For display purposes the entries above have had the names of the servers obfuscated. For example, the reference to “MACH1” represents the DNS name of the production server while “MACH2” represents the DNS name of the server known as the “Web Box”. Therefore the correct names should be substituted. The same holds true for the libraries.

Advertisements

Written by iseriesadmin

June 10, 2012 at 10:24 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: