Agreed!   Simple no-nonsense description - I shall give it a 'whirl' .....
   
  Thanks Len - your on my Xmas list ;-)

"Durfee, Bernard" <[EMAIL PROTECTED]> 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.

Reply via email to