tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject RE: tomcat 4.0.3 and Null datasource
Date Sat, 25 May 2002 05:14:10 GMT
I think you will fine a fine solution here:

http://marc.theaimsgroup.com/?l=tomcat-user&m=102225547106556&w=2

This solved the issue for me...although I am using the latest nightly 
builds of Barracuda, which use DBCP by default, but you can also use DBCP 
with Tomcat 4.0.3 as long as you add the appropriate jars.

Jake

At 05:56 PM 5/24/2002 -0400, you wrote:
>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>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message