Ok, I have tried it....it fails ..or maybe I am helping it fail?
   
  Been fighting with it all morning......I followed your email and the 
doc...here are my entries/values..any opinions on what else to try?
   
   
  1. Resource entry values
  
 <Context path="/DBS3" docBase="DBS3" reloadable="true"  >
   <Resource name="jdbc/deebee"  
  type="javax.sql.DataSource" 
  auth="Container" 
  driverClassName="com.sybase.jdbc3.jdbc.SybDriver"  
  url="jdbc:sybase:Tds:10.xx.xxx.xx:5001"
  username="xxxxx" 
  password="xxxx" 
  maxIdle="15" 
  maxActive="50" 
  maxWait="10000" 
  factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" 
  removeAbandoned="true" 
  removeAbandonedTimeout="60" 
  logAbandoned="true"/>
    </Context> 
  
2. web.xml entry
   
   <description>Sybase Connection Resource</description>
 <resource-ref>
  <res-ref-name>jdbc/deebee</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
 </resource-ref>
  
3. Java code - error checking left out...
   
          Context ctx = new InitialContext();
        DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/deebee");
        Connection dbconn = ds.getConnection() ;
  
5. Put resource entry in file conf/Catalina/localhost/DBS3.xml with following 
error:
  
     "WARNING: A docBase C:\Program Files\Apache Software Foundation\
             Tomcat 5.5\webapps\DBS3 inside the host appBase has been 
             specified, and will be ignored"
   
  6. Put resource entry in server.xml with error.
   
      SQLState: null
    Code: 0
    Message: Cannot create JDBC driver of class '' for connect URL 'null'
 
  
7. Put it in webapps/DBS3/META-INF/context.xml with error.
   
      SQLState: null
    Code: 0
    Message: Cannot create JDBC driver of class '' for connect URL 'null'
   
   
  any suggestions gladly taken ....
Thanks!
   
   
   
   
  

g m <[EMAIL PROTECTED]> wrote:
  Agreed! Simple no-nonsense description - I shall give it a 'whirl' .....

Thanks Len - your on my Xmas list ;-)

"Durfee, Bernard" wrote:
Excellent! That is the exact documentation that should be on the Tomcat
site. It would also be nice to see a quick description of how Tomcat
processes the sections, what exactly it does with the
attributes, so that other drivers and pools can be configured.

There are also other parameters that DBCP accepts...

http://jakarta.apache.org/commons/dbcp/configuration.html

Bernie Durfee 



> -----Original Message-----
> From: Len Popp [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, January 19, 2006 12:58 PM
> To: Tomcat Users List
> Subject: Re: Absolute Guide for config of JDBC Connection Pool ?
> 
> 
> I don't know if there's a complete top-to-bottom guide, but here's
> what I know from setting up connection pooling under 5.5.12:
> 
> 1. The JDBC driver JAR must go in the common/lib directory (because
> for connection pooling it needs to be accessible to both Tomcat and
> the web app).
> 
> 2. DBCP is built into Tomcat so you don't need to install a 
> JAR for that.
> 
> 3. The tag goes inside the tag for the web app,
> wherever it is (server.xml, webapps//META-INF/context.xml or
> conf/Catalina/localhost/.xml)
> Note that the syntax for has changed from earlier versions
> - see the Tomcat documentation. Here's a sample:
> 
> > type="javax.sql.DataSource"
> auth="Container"
> driverClassName="com.mysql.jdbc.Driver"
> url="jdbc:mysql://localhost:3306/???"
> username="???"
> password="???"
> maxIdle="15"
> maxActive="50"
> maxWait="10000"
> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
> removeAbandoned="true"
> removeAbandonedTimeout="60"
> logAbandoned="true"/>
> 
> The "???" bits are installation-dependent. Some of the parameters will
> be different for Sybase (driverClassName and url for sure).
> 
> 4. Yes, it is supposed to say "... .dbcp.dbcp ..." in the 
> factory= line.
> 
> 5. The code to get a DB connection is:
> InitialContext initCtx = new InitialContext();
> DataSource ds = (DataSource) 
> initCtx.lookup("java:comp/env/jdbc/???");
> Connection conn = ds.getConnection();
> Make sure that "jdbc/???" is the same here as in the tag.
> 
> 6. Always close the connection when you're done with it. Use a
> "finally" block to make sure.
> 
> 7. If you're trying to decide where to put the declaration,
> the choices are:
> - server.xml - Don't put it here. We're told it's bad.
> - webapps//META-INF/context.xml - If you put it here, it will be
> bundled up in the app's WAR file. That makes it easier to install, but
> harder to configure if every installation has different details for
> the database tag.
> - conf/Catalina/localhost/.xml - If you put it here, it's easier
> to edit the tag, but it's an extra file to be installed in
> addition to the WAR.
> 
> Hope this helps. At least it's shorter than
> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-exampl
es-howto.html.
:-)

On 1/19/06, g m wrote:
> There seems to be 'truckloads' of information on just as many forums
on how best to setup a JDBC connection pool, varying from which file to
put what entries (server.xml, context.xml, web.xml) etc....
>
> It looks like the same questions be asked in a slightly different
fashion and for different environments.
>
> Does anyone happen to know where there is a definative guide on how
to do this and what jar files one needs ?... or does this sort of 'clean
doc' not exist ?
>
> FYI: My environment: Tomcat 5.5.9, Sybase, Windows .
> Many thanks!

--
Len

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





---------------------------------
Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and 
used cars.  


                
---------------------------------
Yahoo! Photos – Showcase holiday pictures in hardcover
 Photo Books. You design it and we’ll bind it!

Reply via email to