Doug,

Yes, I am using TC5, the drivers work when I connect directly via DriverManager
and are in common/lib.

Here are the relevant parts of my server.xml:

  <GlobalNamingResources>

    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
       description="User database that can be updated and saved">
    </Resource>

            <Resource name="resourceName" auth="Container"
type="javax.sql.DataSource"/> 

            <ResourceParams name="resourceName">

                <parameter>
                    <name>factory</name>
                   
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                </parameter>

                <parameter>
                    <name>maxActive</name>
                    <value>100</value>
                </parameter>

                <parameter>
                    <name>maxIdle</name>
                    <value>30</value>
                </parameter>

                <parameter>
                    <name>maxWait</name>
                    <value>10000</value>
                </parameter>
                
                <parameter>
                    <name>url</name>
                    <value>jdbc:microsoft:sqlserver://hostname</value>
                </parameter>

                <parameter>
                    <name>DatabaseName</name>
                    <value>dbname</value>
                </parameter>

                <parameter>
                    <name>User</name>
                    <value>username</value>
                </parameter>

                <parameter>
                    <name>Password</name>
                    <value>password</value>
                </parameter>

                <parameter>
                    <name>driverClassName</name>
                   
<value>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</value>
                </parameter>
    
            </ResourceParams>

    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>

  </GlobalNamingResources>


>From $TOMCAT_HOME/conf/Catalina/localhost/webappname.xml:

<Context path="/webappname" docBase="webappname" debug="5" reloadable="true"
crossContext="true">

   <Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_webappname_log." suffix=".txt" timestamp="true"/>

   <ResourceLink name="jdbc/dbname"
                 global="resourceName"
                 type="javax.sql.DataSource" />

</Context>


And from web.xml:

  <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/dbname</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>

The code snippet is below, in the original email.

Thank you,
Todd

--- Parsons Technical Services <[EMAIL PROTECTED]> wrote:
> Todd,
> 
> I assume you are running TC5?
> Please post your configs from the server.xml, web.xml, context.xml and code
> snippet you use to get a connection.
> 
> Because you are getting a driver it is at least seeing some of your config.
> 
> Are you using the correct drivers?
> Are they current?
> Are they corrupted?
> 
> Driver jar goes in common/lib.
> 
> Doug
> 
> ----- Original Message ----- 
> From: "Todd H. Siegel" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 24, 2004 10:12 PM
> Subject: No suitable driver
> 
> 
> > All,
> >
> > I know that this issue has been posted many times, I have read many of
> them and
> > and the Tomcat docs but to no avail...
> >
> > The names between the '*'s have been sanitized.
> >
> > The following code:
> >
> > Context initContext = new InitialContext();
> > DataSource ds =
> (DataSource)initContext.lookup("java:/comp/env/jdbc/*DbName*");
> > Connection conn = ds.getConnection();
> >
> > produces the following results:
> >
> > java.lang.Exception: org.apache.commons.dbcp.SQLNestedException: Cannot
> create
> > JDBC driver of class 'com.microsoft.jdbcx.sqlserver.SQLServerDataSource'
> for
> > connect URL 'jdbc:microsoft:sqlserver://*hostname*', cause: No suitable
> driver
> >
> > In the interest of keeping this brief I won't include all of the config,
> but
> > I've tried putting the <Resource> & <ResourceParams> definitions in the
> > <Context> element for the webapp in server.xml.
> >
> > I've also put the <Resource> & <ResourceParams> definitions in the
> > <GlobalNamingResources> in the server.xml with a <ResourceLink> in the
> > <Context> element in $CATALINA_HOME/*webapp*.xml.  I've also tried this
> with a
> > context.xml in the META-INF directory of the webapp.
> >
> > The jars for the driver are in common\lib, but I've also tried putting
> them in
> > every other imaginable lib directory too.
> >
> > I would greatly appreciate any help.
> >
> > Thank you,
> > Todd
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Finance Tax Center - File online. File on time.
> > http://taxes.yahoo.com/filing.html
> >
> > ---------------------------------------------------------------------
> > 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]
> 

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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

Reply via email to