If you're auto-deploying and can get the DefaultContext to work for you,
then that's what I'd do. (I'm not auto-deploying, so my case isn't so
straight-forward).
You always have the fall-back of configuring Context datasources if you run
into trouble.

There's an example of configuring a DefaultContext with a datasource here:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/defaultcontext.html


This is how I've configured my data-source:

<Context docBase="/webapps/isurvey" path="/isurvey" reloadable="true">
           <Resource name="jdbc/as400" auth="Container"
type="javax.sql.DataSource"/>
           <ResourceParams name="jdbc/as400">
           <parameter>
           <name>maxWait</name>
           <value>5000</value>
           </parameter>
           <parameter>
           <name>maxActive</name>
           <value>4</value>
           </parameter>
           <parameter>
           <name>password</name>
           <value>******</value>
           </parameter>
          <parameter>
           <name>url</name>
           <value>jdbc:as400://localhost;naming=system</value>
           </parameter>
           <parameter>
           <name>driverClassName</name>
           <value>com.ibm.as400.access.AS400JDBCDriver</value>
           </parameter>
          <parameter>
           <name>maxIdle</name>
           <value>2</value>
           </parameter>
           <parameter>
           <name>username</name>
           <value>******</value>
           </parameter>
           </ResourceParams>
</Context>

And this is how I use the data-source in java:

        Context ctx = new InitialContext();
        Context envCtx = (Context) ctx.lookup("java:comp/env");
        DataSource ds = (DataSource) envCtx.lookup("jdbc/as400");


I'd be interested to know how you get on with this.

Regards,
John

[EMAIL PROTECTED]
Ph (09) 372-5010


|---------+---------------------------->
|         |           Koon Yue Lam     |
|         |           <[EMAIL PROTECTED]|
|         |           om>              |
|         |                            |
|         |           20/07/2004 02:45 |
|         |           PM               |
|         |           Please respond to|
|         |           "Struts Users    |
|         |           Mailing List"    |
|         |                            |
|---------+---------------------------->
  
>--------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                          |
  |       To:       Struts Users Mailing List <[EMAIL PROTECTED]>                      
                     |
  |       cc:                                                                          
                          |
  |       Subject:  Re: Datasource problem again..                                     
                          |
  
>--------------------------------------------------------------------------------------------------------------|




Thx !
Since I am using Tomct 5 with auto-depoly, my Webapp DOESN'T has a
<Context> element in server.xml. I think I will has a try to setup in
<default-context>, or should I manually all a <context> element of my
Webapp in server.xml??

Regards

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to