tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Dean (Zhun)" <Dean.C...@gs.com>
Subject RE: tomcat 4.0.3 and Null datasource
Date Tue, 28 May 2002 14:08:50 GMT
Thanks,
I can't believe that was it, I was concentrating on the first "D" and
totalling ignored the "S". Thanks again. This is what I get for coding on
Friday! :-)

Dean Chen



-----Original Message-----
From: Phillip Morelock [mailto:subscriptions@phillipmorelock.com]
Sent: Friday, May 24, 2002 6:06 PM
To: Tomcat Users List
Subject: Re: tomcat 4.0.3 and Null datasource


just reading your email, i think you should look at how you spell each
instance of this word:

> setsDatasource


in some places it's setsDataSource

cheers
fillup

----------
Hi,

I am having trouble obtain datasource to get a connection, I've looked over
the mailing archives and followed the directions, but still can't get it to
work.

I'm using I'm using Tomcat 4.0.3 and Sybase jconn2.jar

I have a method that has this

            Context ctx = new InitialContext();
            Context envCtx = (Context) ctx.lookup("java:comp/env/");
    DataSource ds = (DataSource) envCtx.lookup("jdbc/setsDataSource");
    
    however, if I check for  if (ds == null), that is true, so the get
Connection that follows doesn't work.


I have tried different approaches, I've put jconn2.jar in my Web-inf/lib, I
have tried putting jconn2.jar in %tomcat%/common/lib, still doesn't work.

My settings are as follows
server.xml
      <Resource name="jdbc/setsDatasource" auth="Container"
            type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/setsDatasource">
            <parameter><name>driverClassName</name>
              <value>com.sybase.jdbc2.jdbc.SybDriver</value>
            </parameter>
            <parameter><name>url</name>
              <value>jdbc:sybase:Tds:servername:4946/database</value>
            </parameter>
            <parameter><name>user</name><value>username</value></parameter>
 
<parameter><name>password</name><value>password</value></parameter>
          </ResourceParams>

web.xml
  <resource-ref>
        <description>Sets Database</description>
        <res-ref-name>jdbc/setsDataSource</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
  </resource-ref>

Any ideas would be appreciated, thanks.

Dean




--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message