commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Speh <rws...@yahoo.com>
Subject Re: cvs commit: jakarta-commons/dbcp/src/java/org/apache/commons/dbcp BasicDataSource.java BasicDataSourceFactory.java
Date Wed, 16 Jan 2002 14:46:53 GMT
Could you please provide a small example of how to use
the BasicDataSource?

Thank you,
Randy Speh
--- craigmcc@apache.org wrote:
> craigmcc    02/01/15 16:19:36
> 
>   Modified:    dbcp     build.xml
>   Added:       dbcp/src/java/org/apache/commons/dbcp
> BasicDataSource.java
>                         BasicDataSourceFactory.java
>   Log:
>   BasicDataSource - A simple implementation of
> javax.sql.DataSource, based on
>   the POOL and DBCP packages, that is configured
> based on JavaBean properties.
>   
>   BasicDataSourceFactory - A JNDI ObjectFactory
> implementation that can be used
>   to instantiate data source instances in a JNDI
> environment.
>   
>   (Both of these were factored out of some code in
> Tomcat 4, because they are
>   more generally useful over here>)
>   
>   Revision  Changes    Path
>   1.5       +6 -2     
> jakarta-commons/dbcp/build.xml
>   
>   Index: build.xml
>  
>
===================================================================
>   RCS file:
> /home/cvs/jakarta-commons/dbcp/build.xml,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- build.xml	21 Sep 2001 18:01:57 -0000	1.4
>   +++ build.xml	16 Jan 2002 00:19:36 -0000	1.5
>   @@ -1,4 +1,4 @@
>   -<!-- $Id: build.xml,v 1.4 2001/09/21 18:01:57
> craigmcc Exp $ -->
>   +<!-- $Id: build.xml,v 1.5 2002/01/16 00:19:36
> craigmcc Exp $ -->
>    <project name="jakarta-commons-dbcp"
> default="test" basedir=".">
>    
>       <!-- patternset describing files to be copied
> from the doc directory -->
>   @@ -68,6 +68,7 @@
>          <available property="available-doc"
> file="${source.doc}"/> <!-- does this module have
> docs? -->
>          <available property="available-src-java"
> file="${source.src.java}"/> <!-- does this module
> have java src? -->      
>          <available property="available-src-test"
> file="${source.src.test}"/> <!-- does this module
> have test src? -->      
>   +      <available property="jndi.present"
> classname="javax.naming.Context"/>
>    
>       </target>
>    
>   @@ -174,7 +175,10 @@
>                 classpath="${classpath}"
>                 debug="false"
>                 deprecation="true"
>   -             optimize="true"/>
>   +             optimize="true">
>   +        <exclude
>
name="org/apache/commons/dbcp/BasicDataSourceFactory"
>   +               unless="jndi.present"/>
>   +      </javac>
>       </target>
>    
>       <target name="build-test"
> depends="init,build-java" if="available-src-test">
>   
>   
>   
>   1.1                 
>
jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java
>   
>   Index: BasicDataSource.java
>  
>
===================================================================
>   /*
>    * $Header:
>
/home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java,v
> 1.1 2002/01/16 00:19:36 craigmcc Exp $
>    * $Revision: 1.1 $
>    * $Date: 2002/01/16 00:19:36 $
>    *
>    *
>
====================================================================
>    *
>    * The Apache Software License, Version 1.1
>    *
>    * Copyright (c) 1999-2002 The Apache Software
> Foundation.  All rights
>    * reserved.
>    *
>    * Redistribution and use in source and binary
> forms, with or without
>    * modification, are permitted provided that the
> following conditions
>    * are met:
>    *
>    * 1. Redistributions of source code must retain
> the above copyright
>    *    notice, this list of conditions and the
> following disclaimer.
>    *
>    * 2. Redistributions in binary form must
> reproduce the above copyright
>    *    notice, this list of conditions and the
> following disclaimer in
>    *    the documentation and/or other materials
> provided with the
>    *    distribution.
>    *
>    * 3. The end-user documentation included with the
> redistribution, if
>    *    any, must include the following
> acknowlegement:
>    *       "This product includes software developed
> by the
>    *        Apache Software Foundation
> (http://www.apache.org/)."
>    *    Alternately, this acknowlegement may appear
> in the software itself,
>    *    if and wherever such third-party
> acknowlegements normally appear.
>    *
>    * 4. The names "The Jakarta Project", "Commons",
> and "Apache Software
>    *    Foundation" must not be used to endorse or
> promote products derived
>    *    from this software without prior written
> permission. For written
>    *    permission, please contact
> apache@apache.org.
>    *
>    * 5. Products derived from this software may not
> be called "Apache"
>    *    nor may "Apache" appear in their names
> without prior written
>    *    permission of the Apache Group.
>    *
>    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY
> EXPRESSED OR IMPLIED
>    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> IMPLIED WARRANTIES
>    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> PURPOSE ARE
>    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE
> SOFTWARE FOUNDATION OR
>    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
> INDIRECT, INCIDENTAL,
>    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> (INCLUDING, BUT NOT
>    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> SERVICES; LOSS OF
>    * USE, DATA, OR PROFITS; OR BUSINESS
> INTERRUPTION) HOWEVER CAUSED AND
>    * ON ANY THEORY OF LIABILITY, WHETHER IN
> CONTRACT, STRICT LIABILITY,
>    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> ARISING IN ANY WAY OUT
>    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
> THE POSSIBILITY OF
>    * SUCH DAMAGE.
>    *
>
====================================================================
>    *
>    * This software consists of voluntary
> contributions made by many
>    * individuals on behalf of the Apache Software
> Foundation.  For more
>    * information on the Apache Software Foundation,
> please see
>    * <http://www.apache.org/>.
>    *
>    */
>   
>   package org.apache.commons.dbcp;
>   
>   import java.io.PrintWriter;
>   import java.util.Properties;
>   import java.sql.Connection;
>   import java.sql.Driver;
>   import java.sql.SQLException;
>   import javax.sql.DataSource;
>   import
> org.apache.commons.dbcp.DriverConnectionFactory;
>   import
> org.apache.commons.dbcp.PoolableConnectionFactory;
>   import org.apache.commons.dbcp.PoolingDataSource;
>   import
> org.apache.commons.pool.impl.GenericObjectPool;
>   
>   
>   /**
>    * <p>Basic implementation of
> <code>javax.sql.DataSource</code> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

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


Mime
View raw message