cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
83
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: null on 24-04-2003 05:27:23 PM
Hi, I am using Audium 3.2 with Tomcat4.0.6
I wanted to set up a JNDI connectivity to a database,
Can someone help me with a sample server.xml and any other configuration file for tomcat and audium that may be required to do this setup?

Thanks,
Madhavi

Subject: RE: configuring database support
Replied by: null on 25-04-2003 05:28:07 PM
Here are the steps you need to follow:

1) Find the server.xml file stored in the TOMCAT_HOME/conf directory.

2) Open the file and search in it for the part that looks like:

[code:1:c0477e0133]
<!-- Tomcat Root Context -->
<!--
<Context path="" docBase="ROOT" debug="0"/>
-->
[/code:1:c0477e0133]

3) Right underneath it, type in:

[code:1:c0477e0133]
<DefaultContext>
<Resource name="jdbc/YOUR JNDI NAME" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/YOUR JNDI NAME">
<parameter>
<name>user</name>
<value>YOUR USER</value>
</parameter>
<parameter>
<name>password</name>
<value>YOUR PASSWORD</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>YOUR DRIVER CLASS</value>
</parameter>
<parameter>
<name>driverName</name>
<value>YOUR DRIVER NAME URL</value>
</parameter>
</ResourceParams>
</DefaultContext>
[/code:1:c0477e0133]

4) Replace the parts in capital letters with the appropriate data. This data will depend on the database driver you are using, Refer to the documentation of the database driver to see how to write the driver class name and driver name. for example, with MySQL, the driverClassName is "org.gjt.mm.mysql.Driver" and the driverName is "jdbc:mysql://IP ADDRESS:3306/NAME OF DATABASE".

5) Restart Tomcat. Tomcat will automatically handle all the JNDI naming stuff and when you use an Audium database element, you can simply enter the JNDI name you have given.

For more on what you can enter in the server.xml, please refer to:

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/

The place that talks about contexts and default contexts is at :

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/defaultcontext.html

You will also have to look at the documentation of your database driver.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links