Finally I could get the things running. 
 
The things are working when i specified into GlobalResources and GlobalContext 
inside server.xml 
 
My server.xml is something like below..
 
-----------------------------------------
<GlobalNamingResources>
<Resource auth="Container" name="mspool" type="javax.sql.DataSource"/>
    <ResourceParams name="mspool">
      <parameter>
        <name>url</name>
        
<value>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=sbcs</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>30</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>100</value>
      </parameter>
      <parameter>
        <name>driverClassName</name>
        <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
      </parameter>
      <parameter>
        <name>maxWait</name>
        <value>10000</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>manisha</value>
      </parameter>
      <parameter>
        <name>factory</name>
        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
      </parameter>
      <parameter>
        <name>selectMethod</name>
        <value>cursor</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>manisha</value>
      </parameter>
      <parameter>
        <name>removeAbandoned</name>
        <value>true</value>
      </parameter>
      <parameter>
         <name>removeAbandonedTimeout</name>
         <value>60</value>
       </parameter>
       <parameter>
          <name>logAbandoned</name>
          <value>true</value>
       </parameter>
    </ResourceParams>
  </GlobalNamingResources>
.......
....
      <Host appBase="webapps" name="localhost">
        <DefaultContext 
className="org.apache.catalina.core.StandardDefaultContext">
          <ResourceLink global="mspool" name="mspool" 
type="javax.sql.DataSource"/>
        </DefaultContext>
        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="localhost_log." suffix=".txt"
            timestamp="true"/>        
      </Host>      
....
 
I did not change anything inside Web.xml as everything in inside Global.
 
But i do not want it inside global naming resources / default context - but i 
want it only specific to my web application. i also understand that <Context> - 
should not be used for TomCat5.0 - but need to put inside /META-INF/context.xml.
 
1)My problem is my working directory is different. I use ant to create war file 
and then i manually stop the server - delete existing war file / existing 
directory (This is due to some Win TomCat problem .??..). Then i deploy it 
using TomCat Manager. It automatically creates META-INF file for me, i do not 
have such thing inside my working directory. So where i can put my context.xml ?
 
2) What shall i put inside context.xml and what shall i put inside server.xml / 
web/xml ?
 
I tried many different ways but when i use context and as there is no such 
application (because i delete and i re-deploy it) - tomcat server does not run 
my application. 
 
Pls guide me
 
regards
Manisha
 
 
Pavel Kolesnikov <[EMAIL PROTECTED]> wrote:
On Thu, 20 Jan 2005 16:01:55 -0800 (PST), Manisha Sathe
wrote:

> Oh! sorry, i did not make it clear. I do went thr this. Currently i am on
> TomCat but live environment may not be. (I believe this is for TomCat ?? I

Yes, the link I've sent is about Tomcat configuration, but only the part
about configuring a datasource is Tomcat specific. But the sample Java
code for accessing the datasource using JNDI should work with any
application server. 

> Also in instructions MSSQL Database is not mentioned - so not sure what to
> do. Would appreciate if u guide me pls. 

I guess it should be be similar as examples for other databases, just change
the class name of database driver, JDBC url and access information.

Pavel

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to