tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Olliver" <a...@slyfrog.com>
Subject RE: DbcpDataSourceFactory.java
Date Mon, 05 Nov 2001 23:13:37 GMT
Hi

What is the current status with this code ?

I am looking for any JNDI + JDBC 2.0 Datasource solution that I can get
working effectively with TC4.01.

Have tried the tyrex code, but it seems to be the XA implementation rather
than the pool.

Andy

-----Original Message-----
From: craigmcc@apache.org [mailto:craigmcc@apache.org]
Sent: 30 October 2001 05:04
To: jakarta-tomcat-4.0-cvs@apache.org
Subject: cvs commit:
jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory
DbcpDataSourceFactory.java


craigmcc    01/10/29 21:03:51

  Modified:    catalina/src/share/org/apache/naming/factory
                        DbcpDataSourceFactory.java
  Log:
  Forgot the "validationQuery" property.

  Revision  Changes    Path
  1.3       +14 -5
jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/DbcpDataSour
ceFactory.java

  Index: DbcpDataSourceFactory.java
  ===================================================================
  RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/Db
cpDataSourceFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DbcpDataSourceFactory.java	2001/10/30 04:52:16	1.2
  +++ DbcpDataSourceFactory.java	2001/10/30 05:03:51	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/Db
cpDataSourceFactory.java,v 1.2 2001/10/30 04:52:16 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/10/30 04:52:16 $
  + * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/Db
cpDataSourceFactory.java,v 1.3 2001/10/30 05:03:51 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/10/30 05:03:51 $
    *
    * ====================================================================
    *
  @@ -106,10 +106,14 @@
    *     JDBC driver.</li>
    * <li><strong>user</strong> - Database username to be passed to our
    *     JDBC driver.</li>
  + * <li><strong>validationQuery</strong> - SQL query that can be used
to
validate
  + *     connections from this pool.  If specified, this query
  + *     <strong>MUST</strong> be an SQL SELECT that returns at least one
row.
  + *     </li>
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2001/10/30 04:52:16 $
  + * @version $Revision: 1.3 $ $Date: 2001/10/30 05:03:51 $
    */

   public class DbcpDataSourceFactory
  @@ -184,6 +188,11 @@
           if (currentRefAddr != null)
               user = currentRefAddr.getContent().toString();

  +        String validationQuery = null;
  +        currentRefAddr = ref.get("validationQuery");
  +        if (currentRefAddr != null)
  +            validationQuery = currentRefAddr.getContent().toString();
  +
           // Validate our configuration parameters
           if (driverClassName == null)
               throw new NamingException
  @@ -252,7 +261,7 @@
               new DriverManagerConnectionFactory(url, user, password);
           PoolableConnectionFactory poolableConnectionFactory =
               new PoolableConnectionFactory(connectionFactory,
connectionPool,
  -                                          null, null,
  +                                          null, validationQuery,
                                             false, true);
           PoolingDataSource dataSource =
               new PoolingDataSource(connectionPool);




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


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


Mime
View raw message