< < < < > > > >

Configure a Global JNDI Connection in Tomcat

This configuration requires two steps: add the resource definition for your database connection to the context.xml file, and add the database client jar file to the container.

Add the Resource Definition

To add the JNDI database connection, open the context.xml file located in your Tomcat conf directory. For default deployments, this file is located in C:\Program Files (x86)\Pitney Bowes\MapInfo Manager X.x\tomcats_correct_ports\tomcat-5.5.28_repository\conf.

Add the resource definition for your DBMS within the context element:

Oracle
<Resource name="jdbc/OracleTest" auth="Container" type="javax.sql.DataSource"  
driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@myoracle:1521:myora" 
username="admin" password="admin" maxActive="20" maxIdle="10" maxWait="-1" />
			
SQL Server 2008
<Resource name="jdbc/SQL08Test" auth="Container" type="javax.sql.DataSource" 
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"   
url="jdbc:sqlserver://mysqlserverhost:1433;DatabaseName=sstest" username="ssuser"  
password="sspwd" maxActive="20" maxIdle="10" maxWait="-1" /> 
			
PostGIS
<Resource name="jdbc/PostGIS" auth="Container" type="javax.sql.DataSource" 
driverClassName="org.postgresql.Driver" url="jdbc:postgresql://serverhost:port/databasename" username="postgres" password="postgre" maxActive="20" maxIdle="10" maxWait="-1" />
			

where:

Add the Database Client JAR File

To add the DBMS client JAR file to your global Tomcat configuration, you must move the existing service level JAR file to the container lib directory.

To add your database client JAR files to the Tomcat deployment:

Copy ojdbc14.jar (Oracle), sqljdbc4.jar (SQL Server 2008), or postgresql-jdbc4.jar (PostGIS) from the CSW service lib directory into the container lib directory. For default deployments, copy this file from C:\Program Files (x86)\Pitney Bowes\MapInfo Manager X.x\tomcats_correct_ports\tomcat-5.5.28_repository\webapps\CSWService\WEB-INF\lib to C:\Program Files (x86)\Pitney Bowes\MapInfo Manager X.x\tomcats_correct_ports\tomcat-5.5.28_repository\common\lib.

Note: You must restart your Tomcat container once you have completed your configuration.

© 2012 Pitney Bowes Software Inc. Email: pbbi.support@pb.com