tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krishna_R._Naga...@HUD.GOV
Subject Unable to connect to Sybase 11.9.2 server -Help please
Date Fri, 17 Jan 2003 15:00:01 GMT




Hello Everyone,

I am trying to connect to sybase 11.9.2 database server. Has anyone
encountered this error. Your help on this will be greatly appreciated.

I have created a datasource in Tomcat 4.1.18.
I have the jconn2.jar file in webapps/ROOT/WEB_INF/classes/jconn2.jar
I have the jconn2.jar file in c:/tomcat4/commons/lib/jconn2.jar

However I get this error.

java.sql.SQLException: Cannot load JDBC driver class 'null'
      at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:529)
      at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)
      at SecurityCheckServlet.getConnection(SecurityCheckServlet.java:83)
      at SecurityCheckServlet.doGet(SecurityCheckServlet.java:37)

I have the following entries in the server.xml

 <GlobalNamingResources>
    <Environment name="simpleValue" override="true"
type="java.lang.Integer" value="30"/>
    <Resource auth="Container" description="User database that can be
updated and saved" name="UserDatabase" scope="Shareable"
type="org.apache.catalina.UserDatabase"/>
    <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>

    <Resource name="jdbc/MBSDB" scope="Shareable"
type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/MBSDB">
      <parameter>
        <name>username</name>
        <value>jgf</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>mypassword</value>
      </parameter>
     <!-- <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter> -->
      <parameter>
        <name>driverClassName</name>
        <value>com.sybase.jdbc2.jdbc.SybDriver</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:sybase:Tds:192.168.7.42:4100/mydatabase</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>6</value>
      </parameter>
      <parameter>
        <name>maxWait</name>
        <value>5000</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>2</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources>

I have the following entries in the web.xml file

  <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/MBSDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message