Advertisement

10.23.2003 at 09:56PM PDT, ID: 20776662
[x]
Attachment Details

Tomcat Datasource (Urgent!! Please Help)

Asked by tooki in Application Servers

Tags: tomcat

I have tomcat web server (tomcat 4.1.24) running on my Windows2000 PC.
I need to connect to an Oracle database for which I know the Database server hostnaeme,port number, database sid, username and password.

How can I configure my server.xml file (catalina_home/conf/server.xml) so that I can connect to the Oracle database from my JSP code:

Context ic = new InitialContext();
ds = (DataSource) ic.lookup("jdbc/FASTTDS");
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();

I went through the tomcat JNDI documentation (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html)

My server.xml file contains these lines:
****
    <Resource name="FASTTDS" auth="Container"
              type="javax.sql.DataSource"
       description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="jdbc/FASTTDS">
      <parameter>
        <name>factory</name>
        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
      </parameter>
        <parameter>
            <name>driverClassName</name>
            <value>oracle.jdbc.driver.OracleDriver</value>
        </parameter>
  <parameter>
    <name>url</name>
    <value>jdbc:oracle:thin:my_fastt@inch7.rd.com:1521:eflex</value>
  </parameter>
  <parameter>
    <name>username</name>
    <value>my_fastt</value>
  </parameter>
  <parameter>
    <name>password</name>
    <value>my_fastt</value>
  </parameter>
  <parameter>
    <name>maxActive</name>
    <value>20</value>
  </parameter>
  <parameter>
    <name>maxIdle</name>
    <value>10</value>
  </parameter>
  <parameter>
    <name>maxWait</name>
    <value>-1</value>
  </parameter>
    </ResourceParams>
****

Now I stopped the server and with the above server.xml, I cannot start (catalina_home/bin/startup command stops and window closes) the server.So I changed back to the default server.xml, and now I can start tomcat.

This is how I created the web.xml file in my application's WEB-INF directory:
*********
<?xml version = '1.0' encoding = 'UTF-8'?>
<web-app>
   <display-name>FASTT</display-name>
   <description>FASTT</description>
    <res-ref-name>jdbc/FASTTDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
   <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
   </welcome-file-list>
</web-app>
*******
(I did not remove other default lines in server.xml file)

 I am far away from what I need to do. Can you please help me about how I need to create my server.xml file for my JSP application.

-tookiStart Free Trial
[+][-]10.24.2003 at 05:11PM PDT, ID: 9618116

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.25.2003 at 01:48PM PDT, ID: 9620648

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.25.2003 at 02:39PM PDT, ID: 9620746

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.25.2003 at 04:34PM PDT, ID: 9620963

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.26.2003 at 12:13AM PDT, ID: 9621923

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.26.2003 at 09:37AM PST, ID: 9623129

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.26.2003 at 09:58AM PST, ID: 9623192

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.26.2003 at 10:31AM PST, ID: 9623284

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.26.2003 at 01:13PM PST, ID: 9623694

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.26.2003 at 01:23PM PST, ID: 9623716

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.26.2003 at 01:31PM PST, ID: 9623736

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.01.2003 at 12:35PM PST, ID: 9663834

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.13.2003 at 06:13PM PST, ID: 9744601

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.14.2003 at 04:27PM PST, ID: 9752109

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.14.2003 at 04:56PM PST, ID: 9752207

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.15.2003 at 11:32AM PST, ID: 9755143

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.16.2003 at 08:41AM PST, ID: 9758993

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.16.2003 at 10:46AM PST, ID: 9759434

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.19.2003 at 04:41PM PST, ID: 9783841

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.19.2003 at 04:50PM PST, ID: 9783889

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.20.2003 at 12:16AM PST, ID: 9785341

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Application Servers
Tags: tomcat
Sign Up Now!
Solution Provided By: vzilka
Participating Experts: 1
Solution Grade: A
 
 
[+][-]11.27.2003 at 05:37AM PST, ID: 9831594

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.07.2003 at 04:59PM PST, ID: 9893840

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.26.2004 at 01:00PM PDT, ID: 11165132

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]05.30.2004 at 05:09AM PDT, ID: 11190426

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32