From 9595f70fd73e5e6e45c31c2cb5079aad544c40fc Mon Sep 17 00:00:00 2001 From: erik Date: Mon, 14 May 2012 13:37:38 -0700 Subject: [PATCH] Initial commit for Git. --- .cvsignore | 14 +- .gitignore | 10 + build.properties | 50 +- build.xml | 174 ++--- conf/server.xml | 214 +++--- conf/test.jsp | 42 +- lib/commons-logging-api.jar | Bin 22327 -> 26202 bytes simplepool-examples/WEB-INF/web.xml | 102 +-- simplepool-examples/conf/server.xml | 122 +-- simplepool-examples/includes/inst.css | 2 +- simplepool-examples/includes/tigris.css | 2 +- simplepool-examples/index.html | 108 +-- simplepool-examples/jndi/index.jsp | 168 ++--- simplepool-examples/jndi/jstl.jsp | 38 +- simplepool-examples/jndi/scriptlet.jsp | 80 +- simplepool-examples/licenses/JSTL License.txt | 112 +-- .../licenses/SimplePool License.txt | 74 +- simplepool-examples/servlet/index.jsp | 154 ++-- simplepool-examples/servlet/jstl.jsp | 40 +- simplepool-examples/servlet/scriptlet.jsp | 78 +- simplepool-examples/source.jsp | 40 +- src/net/java/dev/simplepool/SimplePool.java | 8 +- .../dev/simplepool/SimplePoolConnection.java | 714 +++++++++--------- .../dev/simplepool/SimplePoolDataSource.java | 636 ++++++++-------- .../SimplePoolDataSourceFactory.java | 280 +++---- .../dev/simplepool/SimplePoolServlet.java | 282 +++---- src/net/java/dev/simplepool/package.html | 26 +- 27 files changed, 1790 insertions(+), 1780 deletions(-) create mode 100644 .gitignore diff --git a/.cvsignore b/.cvsignore index 754e821..51f795f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,8 +1,8 @@ -*.ipr -*.iml -*.iws -bin -dist -build -classes +*.ipr +*.iml +*.iws +bin +dist +build +classes javadoc \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..efe6829 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +*.ipr +*.iml +*.iws +bin +dist +build +classes +javadoc +/CVS/ +CVS \ No newline at end of file diff --git a/build.properties b/build.properties index add7653..27dcf4f 100644 --- a/build.properties +++ b/build.properties @@ -1,26 +1,26 @@ -# Project -proj.name=simplepool -proj.version=1.0 - -# Locations -path.build=build -path.src=src -path.dist=dist -path.lib=lib -path.javadoc=javadoc - -# Jar -jar.name=${proj.name} - -# Examples -ex.name=${proj.name}-examples-${proj.version} -path.ex=${proj.name}-examples - -# Release -release.name=${proj.name}-${proj.version} - -# Javadoc -javadoc.title=SimplePool API -javadoc.api.link=http://java.sun.com/j2se/1.4.2/docs/api -javadoc.servlet.link=http://java.sun.com/products/servlet/2.3/javadoc/ +# Project +proj.name=simplepool +proj.version=1.0 + +# Locations +path.build=build +path.src=src +path.dist=dist +path.lib=lib +path.javadoc=javadoc + +# Jar +jar.name=${proj.name} + +# Examples +ex.name=${proj.name}-examples-${proj.version} +path.ex=${proj.name}-examples + +# Release +release.name=${proj.name}-${proj.version} + +# Javadoc +javadoc.title=SimplePool API +javadoc.api.link=http://java.sun.com/j2se/1.4.2/docs/api +javadoc.servlet.link=http://java.sun.com/products/servlet/2.3/javadoc/ javadoc.packages=net.java.dev.simplepool.* \ No newline at end of file diff --git a/build.xml b/build.xml index 623da7a..97abf91 100644 --- a/build.xml +++ b/build.xml @@ -1,88 +1,88 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/conf/server.xml b/conf/server.xml index 8f04d69..093ca18 100644 --- a/conf/server.xml +++ b/conf/server.xml @@ -1,107 +1,107 @@ - - - - - - - - - - - - - - factory - org.apache.catalina.users.MemoryUserDatabaseFactory - - - pathname - conf/tomcat-users.xml - - - - - - - - - factory - net.java.dev.simplepool.SimplePoolDataSourceFactory - - - driver - com.mysql.jdbc.Driver - - - user - dbuser - - - password - test - - - jdbcUrl - jdbc:mysql://localhost:3306/dbname - - - minConns - 8 - - - maxConns - 30 - - - maxConnTime - 1 - - - maxCheckoutSeconds - 60 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + factory + org.apache.catalina.users.MemoryUserDatabaseFactory + + + pathname + conf/tomcat-users.xml + + + + + + + + + factory + net.java.dev.simplepool.SimplePoolDataSourceFactory + + + driver + com.mysql.jdbc.Driver + + + user + dbuser + + + password + test + + + jdbcUrl + jdbc:mysql://localhost:3306/dbname + + + minConns + 8 + + + maxConns + 30 + + + maxConnTime + 1 + + + maxCheckoutSeconds + 60 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/test.jsp b/conf/test.jsp index 50f1043..9a9272e 100644 --- a/conf/test.jsp +++ b/conf/test.jsp @@ -1,21 +1,21 @@ -<% out.write(""); %> -<%@ page contentType="text/xml;charset=UTF-8"%> -<%@ page session="false"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %> - - - - - select * from entry - - - - - - - - <c:out value="${row.name}"/> - - - +<% out.write(""); %> +<%@ page contentType="text/xml;charset=UTF-8"%> +<%@ page session="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %> + + + + + select * from entry + + + + + + + + <c:out value="${row.name}"/> + + + diff --git a/lib/commons-logging-api.jar b/lib/commons-logging-api.jar index 209bcdfdc31eb0f546b048b15723c2d9f631744c..ade9a13c782cde261208a4d75c7dc391f4c9bcc3 100644 GIT binary patch literal 26202 zcmb@tW0Y*+vL#x!ZQHiF%eHOTF59;4+GX3eZQFKL?{n_y_imrj@AmC6UgjE^`6Ir} zToH4{`eMcmc`0BJD1d)FKq_V!{`uiwFOYxVWki()X(eRE=;i;Kp#VVqeFFcR8Onb) zlM$4a5EE5Wrjrqij_ru)X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Rk4q$=G;AC=b98i zkwueIS+!{v_|SBCLrSq}(K4zYSWKIYxvPTcM2wrd?I>XEPouPzUu_Gg02AJufAvpcw1R;6Z6aRS~!72?V{R?kRbg3exw(jKHd z|ImY~3I2&1YvK3sXvS`cUgAr(TWGA$le zcKWmiPScqyX(_~0BG=QzQK6!zzbsSW#hpG*W?5uE{h++ zwU^RI3k&lbkAIbC#HzpYPl8^R6r$>}U>(i2_@iI5ptYc}MBU;~m5o;XW11N5YIz_Q z&E6D!#i=L-c8BH~I$XO;R6XFu5L@uxfKu|ma5Gp-&U}WShfPWVoB>akC41n!R z#BUPmL899pS%*}qk2v)1nGoUdhZ~6$A!*=)L@J`9-!~%$W+A*?{HE`>cc}+G2zNr_ zA@kkihu+`6I}#QDz8Nu;`F_Ve{l7hcgF=2p1;9OknEwuN`-dLjzXP548|SZVcm5pc zyFMTh?OP)d6GEzFMXZY4vqOYsC^3cK6Y}?c{e4+~q5VTI@LLP*wK1vg5K#_m&pZhQ zn!keI<7knJV;zh^T7XPcFxoQ_LLdGAVtiXMAB;d+R7&J1?O7n}uOsX$Yd#1~T1B`& z|I8e}hW=4G_&0~`AUr7vkywhjXFh~Z_^aIffd6M&h<%5YhezZw?pZ3~-ThC%3GMn% zMB<->lqR-6(QBf=Li|n!__s`ul2`Ua7mEF_(BD~S2a`-nXV?$zBKf~Uf9Jv+geKj0 zB=RBltd`K#f1cuf?1+QFq#I4dZOc8ob?H~YKikAS7>D%9o49SYXMM`QibJ}Ibr6?y iKH5KdKwu=32gy^s4vdPh0ssJx5kA#~BS#(L*?$0X8x%4C diff --git a/simplepool-examples/WEB-INF/web.xml b/simplepool-examples/WEB-INF/web.xml index 9d99df2..a744016 100644 --- a/simplepool-examples/WEB-INF/web.xml +++ b/simplepool-examples/WEB-INF/web.xml @@ -1,52 +1,52 @@ - - - - SimplePool Examples - - - + + + + SimplePool Examples + + + \ No newline at end of file diff --git a/simplepool-examples/conf/server.xml b/simplepool-examples/conf/server.xml index 9004b93..32fa328 100644 --- a/simplepool-examples/conf/server.xml +++ b/simplepool-examples/conf/server.xml @@ -1,62 +1,62 @@ - - - - - - - - - - - - - - - - - - - factory - net.java.dev.simplepool.SimplePoolDataSourceFactory - - - driver - com.mysql.jdbc.Driver - - - user - dbuser - - - password - dbpassword - - - jdbcUrl - jdbc:mysql://localhost:3306/dbname - - - minConns - 8 - - - maxConns - 30 - - - maxConnTime - 1 - - - maxCheckoutSeconds - 60 - - - - - - - - + + + + + + + + + + + + + + + + + + + factory + net.java.dev.simplepool.SimplePoolDataSourceFactory + + + driver + com.mysql.jdbc.Driver + + + user + dbuser + + + password + dbpassword + + + jdbcUrl + jdbc:mysql://localhost:3306/dbname + + + minConns + 8 + + + maxConns + 30 + + + maxConnTime + 1 + + + maxCheckoutSeconds + 60 + + + + + + + + \ No newline at end of file diff --git a/simplepool-examples/includes/inst.css b/simplepool-examples/includes/inst.css index df6d749..e93674e 100644 --- a/simplepool-examples/includes/inst.css +++ b/simplepool-examples/includes/inst.css @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: inst.css,v 1.1 2004/03/20 13:36:08 erik Exp $ This file contains rules that extend or override the more basic formatting defined in tigris.css. Edit it to customize the look of applications using tigris.css (instances). You are responsible for maintaining your own set of (optional) deltas from tigris.css defaults; this file is intended as an example. diff --git a/simplepool-examples/includes/tigris.css b/simplepool-examples/includes/tigris.css index 85892d0..8b5a955 100644 --- a/simplepool-examples/includes/tigris.css +++ b/simplepool-examples/includes/tigris.css @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: tigris.css,v 1.1 2004/03/20 13:36:08 erik Exp $ This file defines basic default formatting for HTML conforming to Tigris application style. To extend or override these rules for your instance, edit inst.css instead of this file. */ diff --git a/simplepool-examples/index.html b/simplepool-examples/index.html index 2719bc3..f997450 100644 --- a/simplepool-examples/index.html +++ b/simplepool-examples/index.html @@ -1,54 +1,54 @@ - - - - -simplepool: Examples - - - - - - - - -
-
-
-

simplepool
- Examples

-
-

Project Home

-
-
- - - - - - - - - - - - - -
SummaryA simple database connection pool for webapps using JSTL.
Example 1JNDI DataSource Examples
Example 2Servlet DataSource Examples
-
-
-

Description

-

SimplePool is a simple database connection pool implementation for web applications, specifically those using JSTL.

-

The connection pool can be created, accessed and managed via JNDI or a provided Servlet.

-

The examples above have been tailored for use with Tomcat and MySQL.

-
-
-
-
- - + + + + +simplepool: Examples + + + + + + + + +
+
+
+

simplepool
+ Examples

+
+

Project Home

+
+
+ + + + + + + + + + + + + +
SummaryA simple database connection pool for webapps using JSTL.
Example 1JNDI DataSource Examples
Example 2Servlet DataSource Examples
+
+
+

Description

+

SimplePool is a simple database connection pool implementation for web applications, specifically those using JSTL.

+

The connection pool can be created, accessed and managed via JNDI or a provided Servlet.

+

The examples above have been tailored for use with Tomcat and MySQL.

+
+
+
+
+ + diff --git a/simplepool-examples/jndi/index.jsp b/simplepool-examples/jndi/index.jsp index d36fea8..88e1961 100644 --- a/simplepool-examples/jndi/index.jsp +++ b/simplepool-examples/jndi/index.jsp @@ -1,84 +1,84 @@ - -<%@page import="javax.naming.*" %> - - - -simplepool: JNDI DataSource Examples - - - - - - - - - -
-
-
-

simplepool
- JNDI DataSource Examples

-
-

Examples Home

-

Please read the instructions before trying to run the examples.

-
-
- - - - - - - - - - - - - -
SummaryA simple database connection pool example using JDNI.
Example 1Scriptlet Example [source]
Example 2JSTL Example [source]
-
-
-

Instructions

-

JNDI is used to create, access and manage the connection pool.

-

First, make sure that your JDBC driver is available, by placing its components in this webapp's WEB-INF/lib/ directory.

-

The JNDI DataSource is defined as naming resource in the current webapp context, as shown in this minimal server configuration file.

-

The JNDI DataSource is configured using the following parameters:

-
    -
  • The varName parameter is used to specify the name of the variable which will hold a reference to the DataSource object created by the Servlet.
  • -
  • The driver parameter is used to specify the name of the JDBC driver class to be registered. For example: com.mysql.jdbc.Driver.
  • -
  • The user parameter is used to specify the database username, if any.
  • -
  • The password parameter is used to specify the database password, if any.
  • -
  • The jdbcUrl parameter is used to specify the JDBC URL associated with the database. For example: jdbc:mysql://localhost:3306/dbname.
  • -
  • The minConns parameter is used to specify the minimum number of connections to start the pool with.
  • -
  • The maxConns parameter is used to specify the maximum number of connections to be dynamically created in the pool.
  • -
  • The maxConnTime parameter is used to specify the time (in days) between connection resets. The pool manager will perform a basic cleanup at the specified interval.
  • -
  • The maxCheckoutSeconds parameter is used to specify the maximum time a connection can be checked out before being recycled. A zero value turns this option off.
  • -
-

Please note that all parameters are required.

-

Please take a minute to incorporate the JDNI DataSource example in your $CATALINE_HOME/conf/server.xml. Once done, please restart Tomcat. The examples will be functional upon restart.

-

Please look at the [source] of the provided examples to understand how to access the connection pool from a scriptlet or using the JSTL SQL tags. The examples demonstrates how to list all of the tables contained in the specified database.

-
-
-
-
- - + +<%@page import="javax.naming.*" %> + + + +simplepool: JNDI DataSource Examples + + + + + + + + + +
+
+
+

simplepool
+ JNDI DataSource Examples

+
+

Examples Home

+

Please read the instructions before trying to run the examples.

+
+
+ + + + + + + + + + + + + +
SummaryA simple database connection pool example using JDNI.
Example 1Scriptlet Example [source]
Example 2JSTL Example [source]
+
+
+

Instructions

+

JNDI is used to create, access and manage the connection pool.

+

First, make sure that your JDBC driver is available, by placing its components in this webapp's WEB-INF/lib/ directory.

+

The JNDI DataSource is defined as naming resource in the current webapp context, as shown in this minimal server configuration file.

+

The JNDI DataSource is configured using the following parameters:

+
    +
  • The varName parameter is used to specify the name of the variable which will hold a reference to the DataSource object created by the Servlet.
  • +
  • The driver parameter is used to specify the name of the JDBC driver class to be registered. For example: com.mysql.jdbc.Driver.
  • +
  • The user parameter is used to specify the database username, if any.
  • +
  • The password parameter is used to specify the database password, if any.
  • +
  • The jdbcUrl parameter is used to specify the JDBC URL associated with the database. For example: jdbc:mysql://localhost:3306/dbname.
  • +
  • The minConns parameter is used to specify the minimum number of connections to start the pool with.
  • +
  • The maxConns parameter is used to specify the maximum number of connections to be dynamically created in the pool.
  • +
  • The maxConnTime parameter is used to specify the time (in days) between connection resets. The pool manager will perform a basic cleanup at the specified interval.
  • +
  • The maxCheckoutSeconds parameter is used to specify the maximum time a connection can be checked out before being recycled. A zero value turns this option off.
  • +
+

Please note that all parameters are required.

+

Please take a minute to incorporate the JDNI DataSource example in your $CATALINE_HOME/conf/server.xml. Once done, please restart Tomcat. The examples will be functional upon restart.

+

Please look at the [source] of the provided examples to understand how to access the connection pool from a scriptlet or using the JSTL SQL tags. The examples demonstrates how to list all of the tables contained in the specified database.

+
+
+
+
+ + diff --git a/simplepool-examples/jndi/jstl.jsp b/simplepool-examples/jndi/jstl.jsp index 7d1eead..5ebb577 100644 --- a/simplepool-examples/jndi/jstl.jsp +++ b/simplepool-examples/jndi/jstl.jsp @@ -1,27 +1,27 @@ -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> -<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %> - - +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %> + + SimplePool JNDI/JSTL Example - - - <%-- Execute the query using our JNDI DataSource --%> - + + + <%-- Execute the query using our JNDI DataSource --%> + SHOW TABLES - - + +

Tables

-
    - - <%-- - Loop through the result set and - display the current column value - --%> +
      + + <%-- + Loop through the result set and + display the current column value + --%>
    • -
      - -
        + + +
          diff --git a/simplepool-examples/jndi/scriptlet.jsp b/simplepool-examples/jndi/scriptlet.jsp index 928bc4d..e271102 100644 --- a/simplepool-examples/jndi/scriptlet.jsp +++ b/simplepool-examples/jndi/scriptlet.jsp @@ -1,45 +1,45 @@ -<%@page import="javax.naming.*, javax.sql.*, java.sql.*;" %> - - - SimplePool JNDI Example +<%@page import="javax.naming.*, javax.sql.*, java.sql.*;" %> + + + SimplePool JNDI Example - - - <% - // Get a new initial JNDI context - Context ctx = new InitialContext(); - + + + <% + // Get a new initial JNDI context + Context ctx = new InitialContext(); + // Get a reference to our JNDI DataSource - DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/JNDIPoolDS"); - - // Get a connection from the pool - Connection conn = ds.getConnection(); - - // Create a new statement - Statement stmt = conn.createStatement(); - - // Execute the query - ResultSet rst = stmt.executeQuery("SHOW TABLES"); - %> - + DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/JNDIPoolDS"); + + // Get a connection from the pool + Connection conn = ds.getConnection(); + + // Create a new statement + Statement stmt = conn.createStatement(); + + // Execute the query + ResultSet rst = stmt.executeQuery("SHOW TABLES"); + %> +

          Tables

          -
            - <% - // Loop through the result set and - // display the current column value - while (rst.next()) { - %> -
          • <%= rst.getString(1) %>
          • - <% - } - %> -
              - - <% - // Close the result set, statement and connection - rst.close(); - stmt.close(); - conn.close(); - %> +
                + <% + // Loop through the result set and + // display the current column value + while (rst.next()) { + %> +
              • <%= rst.getString(1) %>
              • + <% + } + %> +
                  + + <% + // Close the result set, statement and connection + rst.close(); + stmt.close(); + conn.close(); + %> diff --git a/simplepool-examples/licenses/JSTL License.txt b/simplepool-examples/licenses/JSTL License.txt index c62d44b..36866bd 100644 --- a/simplepool-examples/licenses/JSTL License.txt +++ b/simplepool-examples/licenses/JSTL License.txt @@ -1,56 +1,56 @@ -/* ========================================================================= * - * * - * The Apache Software License, Version 1.1 * - * * - * Copyright (c) 1999, 2000 The Apache Software Foundation. * - * All rights reserved. * - * * - * ========================================================================= * - * * - * Redistribution and use in source and binary forms, with or without modi- * - * fication, 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 ." * - * * - * Alternately, this acknowlegement may appear in the software itself, if * - * and wherever such third-party acknowlegements normally appear. * - * * - * 4. The names "The Jakarta Project", "Tomcat", 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 . * - * * - * 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 Software Foundation. * - * * - * 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 indivi- * - * duals on behalf of the Apache Software Foundation. For more information * - * on the Apache Software Foundation, please see . * - * * - * ========================================================================= */ +/* ========================================================================= * + * * + * The Apache Software License, Version 1.1 * + * * + * Copyright (c) 1999, 2000 The Apache Software Foundation. * + * All rights reserved. * + * * + * ========================================================================= * + * * + * Redistribution and use in source and binary forms, with or without modi- * + * fication, 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 ." * + * * + * Alternately, this acknowlegement may appear in the software itself, if * + * and wherever such third-party acknowlegements normally appear. * + * * + * 4. The names "The Jakarta Project", "Tomcat", 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 . * + * * + * 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 Software Foundation. * + * * + * 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 indivi- * + * duals on behalf of the Apache Software Foundation. For more information * + * on the Apache Software Foundation, please see . * + * * + * ========================================================================= */ diff --git a/simplepool-examples/licenses/SimplePool License.txt b/simplepool-examples/licenses/SimplePool License.txt index f4a44ec..75c22f0 100644 --- a/simplepool-examples/licenses/SimplePool License.txt +++ b/simplepool-examples/licenses/SimplePool License.txt @@ -1,38 +1,38 @@ -/* - * $Source$ - * $Revision$ - * $Date$ - * - * Copyright (c) 2004, Russell Beattie (http://www.russellbeattie.com/) - * All rights reserved. - * - * Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the authors nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR - * 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. +/* + * $Source: /home/cvsroot/manywhere/simplepool/simplepool-examples/licenses/SimplePool\040License.txt,v $ + * $Revision: 1.1 $ + * $Date: 2004/03/20 13:36:08 $ + * + * Copyright (c) 2004, Russell Beattie (http://www.russellbeattie.com/) + * All rights reserved. + * + * Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the authors nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR + * 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. */ \ No newline at end of file diff --git a/simplepool-examples/servlet/index.jsp b/simplepool-examples/servlet/index.jsp index 68307da..83d0e15 100644 --- a/simplepool-examples/servlet/index.jsp +++ b/simplepool-examples/servlet/index.jsp @@ -1,77 +1,77 @@ - -<%@page import="javax.naming.*" %> - - - -simplepool: Servlet DataSource Examples - - - - - - - - - -
                  -
                  -
                  -

                  simplepool
                  - Servlet DataSource Examples

                  -
                  -

                  Examples Home

                  -

                  Please read the instructions before trying to run the examples.

                  -
                  -
                  - - - - - - - - - - - - - -
                  SummaryA simple database connection pool example using the SimplePool Servlet.
                  Example 1Scriptlet Example [source]
                  Example 2JSTL Example [source]
                  -
                  -
                  -

                  Instructions

                  -

                  The SimplePoolServlet is used to create, access and manage the connection pool.

                  -

                  First, make sure that your JDBC driver is available, by placing its components in this webapp's WEB-INF/lib/ directory.

                  -

                  The SimplePoolServlet is configured using a set of required initialization parameters, as show in this webapp's WEB-INF/web.xml under the <servlet/> section:

                  -
                    -
                  • The varName initialization parameter is used to specify the name of the variable which will hold a reference to the DataSource object created by the Servlet.
                  • -
                  • The driver initialization parameter is used to specify the name of the JDBC driver class to be registered. For example: com.mysql.jdbc.Driver.
                  • -
                  • The user initialization parameter is used to specify the database username, if any.
                  • -
                  • The password initialization parameter is used to specify the database password, if any.
                  • -
                  • The jdbcUrl initialization parameter is used to specify the JDBC URL associated with the database. For example: jdbc:mysql://localhost:3306/dbname.
                  • -
                  • The minConns initialization parameter is used to specify the minimum number of connections to start the pool with.
                  • -
                  • The maxConns initialization parameter is used to specify the maximum number of connections to be dynamically created in the pool.
                  • -
                  • The maxConnTime initialization parameter is used to specify the time (in days) between connection resets. The pool manager will perform a basic cleanup at the specified interval.
                  • -
                  • The maxCheckoutSeconds initialization parameter is used to specify the maximum time a connection can be checked out before being recycled. A zero value turns this option off.
                  • -
                  -

                  Please note that all parameters are required.

                  -

                  Please take a minute to uncomment the <servlet/> declaration and configure the Servlet's initialization parameters in this webapp's WEB-INF/web.xml. Once done, please restart the webapp and/or Tomcat. The examples will be functional upon restart.

                  -

                  Please look at the [source] of the provided examples to understand how to access the connection pool from a scriptlet or using the JSTL SQL tags. The examples demonstrates how to list all of the tables contained in the specified database.

                  -
                  -
                  -
                  -
                  - - + +<%@page import="javax.naming.*" %> + + + +simplepool: Servlet DataSource Examples + + + + + + + + + +
                  +
                  +
                  +

                  simplepool
                  + Servlet DataSource Examples

                  +
                  +

                  Examples Home

                  +

                  Please read the instructions before trying to run the examples.

                  +
                  +
                  + + + + + + + + + + + + + +
                  SummaryA simple database connection pool example using the SimplePool Servlet.
                  Example 1Scriptlet Example [source]
                  Example 2JSTL Example [source]
                  +
                  +
                  +

                  Instructions

                  +

                  The SimplePoolServlet is used to create, access and manage the connection pool.

                  +

                  First, make sure that your JDBC driver is available, by placing its components in this webapp's WEB-INF/lib/ directory.

                  +

                  The SimplePoolServlet is configured using a set of required initialization parameters, as show in this webapp's WEB-INF/web.xml under the <servlet/> section:

                  +
                    +
                  • The varName initialization parameter is used to specify the name of the variable which will hold a reference to the DataSource object created by the Servlet.
                  • +
                  • The driver initialization parameter is used to specify the name of the JDBC driver class to be registered. For example: com.mysql.jdbc.Driver.
                  • +
                  • The user initialization parameter is used to specify the database username, if any.
                  • +
                  • The password initialization parameter is used to specify the database password, if any.
                  • +
                  • The jdbcUrl initialization parameter is used to specify the JDBC URL associated with the database. For example: jdbc:mysql://localhost:3306/dbname.
                  • +
                  • The minConns initialization parameter is used to specify the minimum number of connections to start the pool with.
                  • +
                  • The maxConns initialization parameter is used to specify the maximum number of connections to be dynamically created in the pool.
                  • +
                  • The maxConnTime initialization parameter is used to specify the time (in days) between connection resets. The pool manager will perform a basic cleanup at the specified interval.
                  • +
                  • The maxCheckoutSeconds initialization parameter is used to specify the maximum time a connection can be checked out before being recycled. A zero value turns this option off.
                  • +
                  +

                  Please note that all parameters are required.

                  +

                  Please take a minute to uncomment the <servlet/> declaration and configure the Servlet's initialization parameters in this webapp's WEB-INF/web.xml. Once done, please restart the webapp and/or Tomcat. The examples will be functional upon restart.

                  +

                  Please look at the [source] of the provided examples to understand how to access the connection pool from a scriptlet or using the JSTL SQL tags. The examples demonstrates how to list all of the tables contained in the specified database.

                  +
                  +
                  +
                  +
                  + + diff --git a/simplepool-examples/servlet/jstl.jsp b/simplepool-examples/servlet/jstl.jsp index a895343..8cf9397 100644 --- a/simplepool-examples/servlet/jstl.jsp +++ b/simplepool-examples/servlet/jstl.jsp @@ -1,27 +1,27 @@ -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> -<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %> - - - SimplePool Servlet/JSTL Example +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %> + + + SimplePool Servlet/JSTL Example - - - <%-- Execute the query using our DataSource --%> - + + + <%-- Execute the query using our DataSource --%> + SHOW TABLES - - + +

                  Tables

                  -
                    - - <%-- - Loop through the result set and - display the current column value - --%> +
                      + + <%-- + Loop through the result set and + display the current column value + --%>
                    • -
                      - -
                        + + +
                          \ No newline at end of file diff --git a/simplepool-examples/servlet/scriptlet.jsp b/simplepool-examples/servlet/scriptlet.jsp index fa83103..438ee2d 100644 --- a/simplepool-examples/servlet/scriptlet.jsp +++ b/simplepool-examples/servlet/scriptlet.jsp @@ -1,44 +1,44 @@ -<%@page import="javax.naming.*, javax.sql.*, java.sql.*;" %> - - - SimplePool Servlet Example +<%@page import="javax.naming.*, javax.sql.*, java.sql.*;" %> + + + SimplePool Servlet Example - - - <% + + + <% // Get a reference to our DataSource - DataSource ds = (DataSource) pageContext.findAttribute("ServletPoolDS"); - - // Get a connection from the pool - Connection conn = ds.getConnection(); - - // Create a new statement - Statement stmt = conn.createStatement(); - - // Execute the query - ResultSet rst = stmt.executeQuery("SHOW TABLES"); - %> - + DataSource ds = (DataSource) pageContext.findAttribute("ServletPoolDS"); + + // Get a connection from the pool + Connection conn = ds.getConnection(); + + // Create a new statement + Statement stmt = conn.createStatement(); + + // Execute the query + ResultSet rst = stmt.executeQuery("SHOW TABLES"); + %> +

                          Tables

                          -
                            - <% - // Loop through the result set and - // display the current column value - while (rst.next()) { - %> -
                          • <%= rst.getString(1) %>
                          • - <% - } - %> -
                              - - <% - // Close the result set, statement and connection - // and display the current column value - rst.close(); - stmt.close(); - conn.close(); - %> +
                                + <% + // Loop through the result set and + // display the current column value + while (rst.next()) { + %> +
                              • <%= rst.getString(1) %>
                              • + <% + } + %> +
                                  + + <% + // Close the result set, statement and connection + // and display the current column value + rst.close(); + stmt.close(); + conn.close(); + %> - + diff --git a/simplepool-examples/source.jsp b/simplepool-examples/source.jsp index 7c080eb..b13d783 100644 --- a/simplepool-examples/source.jsp +++ b/simplepool-examples/source.jsp @@ -1,25 +1,25 @@ -<%@page import="java.io.*"%> - - -
                                  -<%
                                  +<%@page import="java.io.*"%>
                                  +
                                  +
                                  +
                                  +<%
                                   	String file = request.getParameter("file"); 
                                   	if ((file != null) && (file.trim().length() > 0) && (file.indexOf( ".." ) == -1)) { 
                                   		InputStream is = pageContext.getServletContext().getResourceAsStream(file); 
                                  -		if (is != null) {
                                  -			InputStreamReader isr = new InputStreamReader(is);
                                  -			for (int ch = isr.read(); ch != -1; ch = isr.read()) {
                                  -				if (ch == '<') {
                                  -					out.print("<");
                                  -				} else if (ch == '\t') {
                                  -					out.print("  ");
                                  -				} else {
                                  -					out.print((char) ch);
                                  -				}
                                  -			}
                                  -		}       
                                  -	}
                                  -%>
                                  -
                                  + if (is != null) { + InputStreamReader isr = new InputStreamReader(is); + for (int ch = isr.read(); ch != -1; ch = isr.read()) { + if (ch == '<') { + out.print("<"); + } else if (ch == '\t') { + out.print(" "); + } else { + out.print((char) ch); + } + } + } + } +%> +
                                  diff --git a/src/net/java/dev/simplepool/SimplePool.java b/src/net/java/dev/simplepool/SimplePool.java index eae8267..ef96776 100644 --- a/src/net/java/dev/simplepool/SimplePool.java +++ b/src/net/java/dev/simplepool/SimplePool.java @@ -1,7 +1,7 @@ /* - * $Source$ - * $Revision$ - * $Date$ + * $Source: /home/cvsroot/manywhere/simplepool/src/net/java/dev/simplepool/SimplePool.java,v $ + * $Revision: 1.5 $ + * $Date: 2004/03/17 23:35:36 $ * * Copyright (c) 2002, Marc A. Mnich (http://www.javaexchange.com/) * All rights reserved. @@ -33,7 +33,7 @@ import java.util.Date; * @author Marc A. Mnich * @author Russell Beattie * @author Erik C. Thauvin - * @version $Revision$, $Date$ + * @version $Revision: 1.5 $, $Date: 2004/03/17 23:35:36 $ * @since 1.0 */ public class SimplePool implements Runnable { diff --git a/src/net/java/dev/simplepool/SimplePoolConnection.java b/src/net/java/dev/simplepool/SimplePoolConnection.java index 8dada04..f62eff8 100644 --- a/src/net/java/dev/simplepool/SimplePoolConnection.java +++ b/src/net/java/dev/simplepool/SimplePoolConnection.java @@ -1,357 +1,357 @@ -/* - * $Source$ - * $Revision$ - * $Date$ - * - * Copyright (c) 2004, Russell Beattie (http://www.russellbeattie.com/) - * All rights reserved. - * - * Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the authors nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR - * 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. - */ -package net.java.dev.simplepool; - -import java.sql.*; -import java.util.Map; - - -/** - * Basic implementation of {@link java.sql.Connection}. - * - * @author Russell Beattie - * @author Erik C. Thauvin - * @version $Revision$, $Date$ - * @since 1.0 - */ -public class SimplePoolConnection implements Connection { - - private Connection conn; - private SimplePool pool; - - /** - * Creates a new SimplePoolConnection object. - * - * @param pool The connection pool. - */ - public SimplePoolConnection(SimplePool pool) { - this.pool = pool; - conn = pool.getConnection(); - } - - /** - * See {@link java.sql.Connection#setAutoCommit(boolean)}. - */ - public void setAutoCommit(boolean autoCommit) - throws SQLException { - conn.setAutoCommit(autoCommit); - } - - /** - * See {@link java.sql.Connection#getAutoCommit}. - */ - public boolean getAutoCommit() - throws SQLException { - return conn.getAutoCommit(); - } - - /** - * See {@link java.sql.Connection#setCatalog(String)}. - */ - public void setCatalog(String catalog) - throws SQLException { - conn.setCatalog(catalog); - } - - /** - * See {@link java.sql.Connection#getCatalog()}. - */ - public String getCatalog() - throws SQLException { - return conn.getCatalog(); - } - - /** - * See {@link java.sql.Connection#isClosed}. - */ - public boolean isClosed() - throws SQLException { - return conn.isClosed(); - } - - /** - * See {@link java.sql.Connection#setHoldability(int)}. - */ - public void setHoldability(int holdability) - throws SQLException { - conn.setHoldability(holdability); - } - - /** - * See {@link java.sql.Connection#getHoldability}. - */ - public int getHoldability() - throws SQLException { - return conn.getHoldability(); - } - - /** - * See {@link java.sql.Connection#getMetaData}. - */ - public DatabaseMetaData getMetaData() - throws SQLException { - return conn.getMetaData(); - } - - /** - * See {@link java.sql.Connection#setReadOnly(boolean)}. - */ - public void setReadOnly(boolean readOnly) - throws SQLException { - conn.setReadOnly(readOnly); - } - - /** - * See {@link java.sql.Connection#isReadOnly}. - */ - public boolean isReadOnly() - throws SQLException { - return conn.isReadOnly(); - } - - /** - * See {@link java.sql.Connection#setSavepoint}. - */ - public Savepoint setSavepoint() - throws SQLException { - return conn.setSavepoint(); - } - - /** - * See {@link java.sql.Connection#setSavepoint(String)}. - */ - public Savepoint setSavepoint(String savepoint) - throws SQLException { - return conn.setSavepoint(savepoint); - } - - /** - * See {@link java.sql.Connection#setTransactionIsolation(int)}. - */ - public void setTransactionIsolation(int level) - throws SQLException { - conn.setTransactionIsolation(level); - } - - /** - * See {@link java.sql.Connection#getTransactionIsolation}. - */ - public int getTransactionIsolation() - throws SQLException { - return conn.getTransactionIsolation(); - } - - /** - * See {@link java.sql.Connection#setTypeMap(Map)}. - */ - public void setTypeMap(Map map) - throws SQLException { - conn.setTypeMap(map); - } - - /** - * See {@link java.sql.Connection#getTypeMap}. - */ - public Map getTypeMap() - throws SQLException { - return conn.getTypeMap(); - } - - /** - * See {@link java.sql.Connection#getWarnings}. - */ - public SQLWarning getWarnings() - throws SQLException { - return conn.getWarnings(); - } - - /** - * See {@link java.sql.Connection#clearWarnings}. - */ - public void clearWarnings() - throws SQLException { - conn.clearWarnings(); - } - - /** - * See {@link java.sql.Connection#close}. - */ - public void close() - throws SQLException { - pool.freeConnection(conn); - } - - /** - * See {@link java.sql.Connection#commit}. - */ - public void commit() - throws SQLException { - conn.commit(); - } - - /** - * See {@link java.sql.Connection#createStatement}. - */ - public Statement createStatement() - throws SQLException { - return conn.createStatement(); - } - - /** - * See {@link java.sql.Connection#createStatement(int, int)}. - */ - public Statement createStatement(int resultSetType, int resultSetConcurrency) - throws SQLException { - return conn.createStatement(resultSetType, resultSetConcurrency); - } - - /** - * See {@link java.sql.Connection#createStatement(int, int, int)}. - */ - public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) - throws SQLException { - return conn.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); - } - - /** - * See {@link java.sql.Connection#nativeSQL(String)}. - */ - public String nativeSQL(String sql) - throws SQLException { - return conn.nativeSQL(sql); - } - - /** - * See {@link java.sql.Connection#prepareCall(String)}. - */ - public CallableStatement prepareCall(String sql) - throws SQLException { - return conn.prepareCall(sql); - } - - /** - * See {@link java.sql.Connection#prepareCall(String, int, int)}. - */ - public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) - throws SQLException { - return conn.prepareCall(sql, resultSetType, resultSetConcurrency); - } - - /** - * See {@link java.sql.Connection#prepareCall(String, int, int, int)}. - */ - public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, - int resultSetHoldability) - throws SQLException { - return conn.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability); - } - - /** - * See {@link java.sql.Connection#prepareStatement(String)}. - */ - public PreparedStatement prepareStatement(String sql) - throws SQLException { - return conn.prepareStatement(sql); - } - - /** - * See {@link java.sql.Connection#prepareStatement(String)}. - */ - public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) - throws SQLException { - return conn.prepareStatement(sql); - } - - /** - * See {@link java.sql.Connection#prepareStatement(String, int, int)}. - */ - public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) - throws SQLException { - return conn.prepareStatement(sql, resultSetType, resultSetConcurrency); - } - - /** - * See {@link java.sql.Connection#prepareStatement(String, int, int, int)}. - */ - public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, - int resultSetHoldability) - throws SQLException { - return conn.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability); - } - - /** - * See {@link java.sql.Connection#prepareStatement(String, int[])}. - */ - public PreparedStatement prepareStatement(String sql, int[] columnIndexes) - throws SQLException { - return conn.prepareStatement(sql, columnIndexes); - } - - /** - * See {@link java.sql.Connection#prepareStatement(String, String[])}. - */ - public PreparedStatement prepareStatement(String sql, String[] columnNames) - throws SQLException { - return conn.prepareStatement(sql, columnNames); - } - - /** - * See {@link java.sql.Connection#releaseSavepoint(Savepoint)}. - */ - public void releaseSavepoint(Savepoint savepoint) - throws SQLException { - conn.releaseSavepoint(savepoint); - } - - /** - * See {@link java.sql.Connection#rollback}. - */ - public void rollback() - throws SQLException { - conn.rollback(); - } - - /** - * See {@link java.sql.Connection#rollback(Savepoint)}. - */ - public void rollback(Savepoint savepoint) - throws SQLException { - conn.rollback(savepoint); - } -} +/* + * $Source: /home/cvsroot/manywhere/simplepool/src/net/java/dev/simplepool/SimplePoolConnection.java,v $ + * $Revision: 1.5 $ + * $Date: 2004/03/17 23:35:36 $ + * + * Copyright (c) 2004, Russell Beattie (http://www.russellbeattie.com/) + * All rights reserved. + * + * Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the authors nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR + * 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. + */ +package net.java.dev.simplepool; + +import java.sql.*; +import java.util.Map; + + +/** + * Basic implementation of {@link java.sql.Connection}. + * + * @author Russell Beattie + * @author Erik C. Thauvin + * @version $Revision: 1.5 $, $Date: 2004/03/17 23:35:36 $ + * @since 1.0 + */ +public class SimplePoolConnection implements Connection { + + private Connection conn; + private SimplePool pool; + + /** + * Creates a new SimplePoolConnection object. + * + * @param pool The connection pool. + */ + public SimplePoolConnection(SimplePool pool) { + this.pool = pool; + conn = pool.getConnection(); + } + + /** + * See {@link java.sql.Connection#setAutoCommit(boolean)}. + */ + public void setAutoCommit(boolean autoCommit) + throws SQLException { + conn.setAutoCommit(autoCommit); + } + + /** + * See {@link java.sql.Connection#getAutoCommit}. + */ + public boolean getAutoCommit() + throws SQLException { + return conn.getAutoCommit(); + } + + /** + * See {@link java.sql.Connection#setCatalog(String)}. + */ + public void setCatalog(String catalog) + throws SQLException { + conn.setCatalog(catalog); + } + + /** + * See {@link java.sql.Connection#getCatalog()}. + */ + public String getCatalog() + throws SQLException { + return conn.getCatalog(); + } + + /** + * See {@link java.sql.Connection#isClosed}. + */ + public boolean isClosed() + throws SQLException { + return conn.isClosed(); + } + + /** + * See {@link java.sql.Connection#setHoldability(int)}. + */ + public void setHoldability(int holdability) + throws SQLException { + conn.setHoldability(holdability); + } + + /** + * See {@link java.sql.Connection#getHoldability}. + */ + public int getHoldability() + throws SQLException { + return conn.getHoldability(); + } + + /** + * See {@link java.sql.Connection#getMetaData}. + */ + public DatabaseMetaData getMetaData() + throws SQLException { + return conn.getMetaData(); + } + + /** + * See {@link java.sql.Connection#setReadOnly(boolean)}. + */ + public void setReadOnly(boolean readOnly) + throws SQLException { + conn.setReadOnly(readOnly); + } + + /** + * See {@link java.sql.Connection#isReadOnly}. + */ + public boolean isReadOnly() + throws SQLException { + return conn.isReadOnly(); + } + + /** + * See {@link java.sql.Connection#setSavepoint}. + */ + public Savepoint setSavepoint() + throws SQLException { + return conn.setSavepoint(); + } + + /** + * See {@link java.sql.Connection#setSavepoint(String)}. + */ + public Savepoint setSavepoint(String savepoint) + throws SQLException { + return conn.setSavepoint(savepoint); + } + + /** + * See {@link java.sql.Connection#setTransactionIsolation(int)}. + */ + public void setTransactionIsolation(int level) + throws SQLException { + conn.setTransactionIsolation(level); + } + + /** + * See {@link java.sql.Connection#getTransactionIsolation}. + */ + public int getTransactionIsolation() + throws SQLException { + return conn.getTransactionIsolation(); + } + + /** + * See {@link java.sql.Connection#setTypeMap(Map)}. + */ + public void setTypeMap(Map map) + throws SQLException { + conn.setTypeMap(map); + } + + /** + * See {@link java.sql.Connection#getTypeMap}. + */ + public Map getTypeMap() + throws SQLException { + return conn.getTypeMap(); + } + + /** + * See {@link java.sql.Connection#getWarnings}. + */ + public SQLWarning getWarnings() + throws SQLException { + return conn.getWarnings(); + } + + /** + * See {@link java.sql.Connection#clearWarnings}. + */ + public void clearWarnings() + throws SQLException { + conn.clearWarnings(); + } + + /** + * See {@link java.sql.Connection#close}. + */ + public void close() + throws SQLException { + pool.freeConnection(conn); + } + + /** + * See {@link java.sql.Connection#commit}. + */ + public void commit() + throws SQLException { + conn.commit(); + } + + /** + * See {@link java.sql.Connection#createStatement}. + */ + public Statement createStatement() + throws SQLException { + return conn.createStatement(); + } + + /** + * See {@link java.sql.Connection#createStatement(int, int)}. + */ + public Statement createStatement(int resultSetType, int resultSetConcurrency) + throws SQLException { + return conn.createStatement(resultSetType, resultSetConcurrency); + } + + /** + * See {@link java.sql.Connection#createStatement(int, int, int)}. + */ + public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) + throws SQLException { + return conn.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); + } + + /** + * See {@link java.sql.Connection#nativeSQL(String)}. + */ + public String nativeSQL(String sql) + throws SQLException { + return conn.nativeSQL(sql); + } + + /** + * See {@link java.sql.Connection#prepareCall(String)}. + */ + public CallableStatement prepareCall(String sql) + throws SQLException { + return conn.prepareCall(sql); + } + + /** + * See {@link java.sql.Connection#prepareCall(String, int, int)}. + */ + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) + throws SQLException { + return conn.prepareCall(sql, resultSetType, resultSetConcurrency); + } + + /** + * See {@link java.sql.Connection#prepareCall(String, int, int, int)}. + */ + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, + int resultSetHoldability) + throws SQLException { + return conn.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability); + } + + /** + * See {@link java.sql.Connection#prepareStatement(String)}. + */ + public PreparedStatement prepareStatement(String sql) + throws SQLException { + return conn.prepareStatement(sql); + } + + /** + * See {@link java.sql.Connection#prepareStatement(String)}. + */ + public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) + throws SQLException { + return conn.prepareStatement(sql); + } + + /** + * See {@link java.sql.Connection#prepareStatement(String, int, int)}. + */ + public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) + throws SQLException { + return conn.prepareStatement(sql, resultSetType, resultSetConcurrency); + } + + /** + * See {@link java.sql.Connection#prepareStatement(String, int, int, int)}. + */ + public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, + int resultSetHoldability) + throws SQLException { + return conn.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability); + } + + /** + * See {@link java.sql.Connection#prepareStatement(String, int[])}. + */ + public PreparedStatement prepareStatement(String sql, int[] columnIndexes) + throws SQLException { + return conn.prepareStatement(sql, columnIndexes); + } + + /** + * See {@link java.sql.Connection#prepareStatement(String, String[])}. + */ + public PreparedStatement prepareStatement(String sql, String[] columnNames) + throws SQLException { + return conn.prepareStatement(sql, columnNames); + } + + /** + * See {@link java.sql.Connection#releaseSavepoint(Savepoint)}. + */ + public void releaseSavepoint(Savepoint savepoint) + throws SQLException { + conn.releaseSavepoint(savepoint); + } + + /** + * See {@link java.sql.Connection#rollback}. + */ + public void rollback() + throws SQLException { + conn.rollback(); + } + + /** + * See {@link java.sql.Connection#rollback(Savepoint)}. + */ + public void rollback(Savepoint savepoint) + throws SQLException { + conn.rollback(savepoint); + } +} diff --git a/src/net/java/dev/simplepool/SimplePoolDataSource.java b/src/net/java/dev/simplepool/SimplePoolDataSource.java index e756646..39d2250 100644 --- a/src/net/java/dev/simplepool/SimplePoolDataSource.java +++ b/src/net/java/dev/simplepool/SimplePoolDataSource.java @@ -1,319 +1,319 @@ -/* - * $Source$ - * $Revision$ - * $Date$ - * - * Copyright (c) 2004, Russell Beattie (http://www.russellbeattie.com/) - * All rights reserved. - * - * Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the authors nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR - * 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. - */ -package net.java.dev.simplepool; - -import javax.sql.DataSource; -import java.io.PrintWriter; -import java.sql.Connection; -import java.sql.SQLException; - -/** - * Basic implementation of {@link javax.sql.DataSource}. - * - * @author Russell Beattie - * @author Erik C. Thauvin - * @version $Revision$, $Date$ - * @since 1.0 - */ -public class SimplePoolDataSource implements DataSource { - - private PrintWriter logWriter = new PrintWriter(System.out); - private SimplePool pool = null; - - private String driver = ""; - private String jdbcUrl = ""; - private String user = ""; - private String password = ""; - private String minConns = ""; - private String maxConns = ""; - private String maxConnTime = ""; - private String maxCheckoutSeconds = ""; - - /** - * Initializes the connection pool. - * - * @throws Exception if the pool could not be intialized. - */ - protected void init() throws Exception { - - pool = new SimplePool(driver, jdbcUrl, user, password, - Integer.parseInt(minConns), Integer.parseInt(maxConns), - Double.parseDouble(maxConnTime), Integer.parseInt(maxCheckoutSeconds)); - - } - - /** - * See {@link javax.sql.DataSource#getConnection()}. - */ - public Connection getConnection() throws SQLException { - - if (pool == null) { - try { - init(); - } catch (Exception e) { - throw new SQLException("Error initializing Connection Broker."); - } - } - - return new SimplePoolConnection(pool); - - } - - /** - * See {@link javax.sql.DataSource#getConnection(String, String)}. - */ - public Connection getConnection(String username, String password) - throws SQLException { - - throw new SQLException("Not supported in this DataSource."); - - } - - /** - * See {@link javax.sql.DataSource#setLogWriter(PrintWriter)}. - */ - public void setLogWriter(PrintWriter out) throws SQLException { - logWriter = out; - } - - /** - * See {@link javax.sql.DataSource#getLogWriter}. - */ - public PrintWriter getLogWriter() { - return logWriter; - } - - /** - * See {@link javax.sql.DataSource#setLoginTimeout(int)}. - */ - public void setLoginTimeout(int seconds) throws SQLException { - } - - /** - * See {@link javax.sql.DataSource#getLoginTimeout}. - */ - public int getLoginTimeout() { - return 0; - } - - /** - * Closes the connection pool. - */ - public void close() { - pool.destroy(); - pool = null; - } - - /** - * Sets the JDBC driver. - * - * @param driver The JDBC driver. e.g. 'com.mysql.jdbc.Driver' - * - * @see #getDriver() - */ - public void setDriver(String driver) { - this.driver = driver; - } - - /** - * Gets the JDBC driver. - * - * @return The JDBC driver string. - * - * @see #setDriver(String) - */ - public String getDriver() { - return driver; - } - - /** - * Sets the JDBC connect string. - * - * @param jdbcUrl The JDBC connection URL string. e.g. 'jdbc:mysql://localhost:3306/dbname' - * - * @see #getJdbcUrl() - */ - public void setJdbcUrl(String jdbcUrl) { - this.jdbcUrl = jdbcUrl; - } - - /** - * Gets the JDBC connect string. - * - * @return The JDBC connection URL string. - * - * @see #setJdbcUrl(String) - */ - public String getJdbcUrl() { - return jdbcUrl; - } - - /** - * Sets the database login name. - * - * @param user The database login name. e.g. 'Scott' - * - * @see #getUser() - */ - public void setUser(String user) { - this.user = user; - } - - /** - * Gets the database login name. - * - * @return The login name string. - * - * @see #setUser(String) - */ - public String getUser() { - return user; - } - - /** - * Sets the database password. - * - * @param password The database password. e.g. 'Tiger' - * - * @see #getPassword() - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * Gets the database password. - * - * @return The password string. - * - * @see #setPassword(String) - */ - public String getPassword() { - return password; - } - - /** - * Sets the minimum number of connections to start with. - * - * @param minConns The minimum number of connections. - * - * @see #getMinConns() - */ - public void setMinConns(String minConns) { - this.minConns = minConns; - } - - /** - * Gets the minimum number of connections to start with. - * - * @return The minimum number of connections string. - * - * @see #setMinConns(String) - */ - public String getMinConns() { - return minConns; - } - - /** - * Sets the maximum number of connections in dynamic pool. - * - * @param maxConns The maximum number of connections. - * - * @see #getMaxConns() - */ - public void setMaxConns(String maxConns) { - this.maxConns = maxConns; - } - - /** - * Gets the maximum number of connections in dynamic pool. - * - * @return The maximum number of connection string. - * - * @see #setMaxConns(String) - */ - public String getMaxConns() { - return maxConns; - } - - /** - * Sets the time in days between connection resets. - * - * @param maxConnTime The maximum connection time. - * - * @see #getMaxConnTime() - */ - public void setMaxConnTime(String maxConnTime) { - this.maxConnTime = maxConnTime; - } - - /** - * Gets the time in days between connection resets. - * - * @return The maximum connection time string. - * - * @see #setMaxConnTime(String) - */ - public String getMaxConnTime() { - return maxConnTime; - } - - /** - * Sets the max time a connection can be checked out before being recycled. - * - * @param maxCheckoutSeconds The maximum number of seconds to wait before recycling a connection. - * - * @see #getMaxCheckoutSeconds() - */ - public void setMaxCheckoutSeconds(String maxCheckoutSeconds) { - this.maxCheckoutSeconds = maxCheckoutSeconds; - } - - /** - * Gets the max time a connection can be checked out before being recycled. - * - * @return The maximum checkout time string. - * - * @see #setMaxCheckoutSeconds(String) - */ - public String getMaxCheckoutSeconds() { - return maxCheckoutSeconds; - } - +/* + * $Source: /home/cvsroot/manywhere/simplepool/src/net/java/dev/simplepool/SimplePoolDataSource.java,v $ + * $Revision: 1.4 $ + * $Date: 2004/03/17 23:19:02 $ + * + * Copyright (c) 2004, Russell Beattie (http://www.russellbeattie.com/) + * All rights reserved. + * + * Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the authors nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR + * 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. + */ +package net.java.dev.simplepool; + +import javax.sql.DataSource; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.SQLException; + +/** + * Basic implementation of {@link javax.sql.DataSource}. + * + * @author Russell Beattie + * @author Erik C. Thauvin + * @version $Revision: 1.4 $, $Date: 2004/03/17 23:19:02 $ + * @since 1.0 + */ +public class SimplePoolDataSource implements DataSource { + + private PrintWriter logWriter = new PrintWriter(System.out); + private SimplePool pool = null; + + private String driver = ""; + private String jdbcUrl = ""; + private String user = ""; + private String password = ""; + private String minConns = ""; + private String maxConns = ""; + private String maxConnTime = ""; + private String maxCheckoutSeconds = ""; + + /** + * Initializes the connection pool. + * + * @throws Exception if the pool could not be intialized. + */ + protected void init() throws Exception { + + pool = new SimplePool(driver, jdbcUrl, user, password, + Integer.parseInt(minConns), Integer.parseInt(maxConns), + Double.parseDouble(maxConnTime), Integer.parseInt(maxCheckoutSeconds)); + + } + + /** + * See {@link javax.sql.DataSource#getConnection()}. + */ + public Connection getConnection() throws SQLException { + + if (pool == null) { + try { + init(); + } catch (Exception e) { + throw new SQLException("Error initializing Connection Broker."); + } + } + + return new SimplePoolConnection(pool); + + } + + /** + * See {@link javax.sql.DataSource#getConnection(String, String)}. + */ + public Connection getConnection(String username, String password) + throws SQLException { + + throw new SQLException("Not supported in this DataSource."); + + } + + /** + * See {@link javax.sql.DataSource#setLogWriter(PrintWriter)}. + */ + public void setLogWriter(PrintWriter out) throws SQLException { + logWriter = out; + } + + /** + * See {@link javax.sql.DataSource#getLogWriter}. + */ + public PrintWriter getLogWriter() { + return logWriter; + } + + /** + * See {@link javax.sql.DataSource#setLoginTimeout(int)}. + */ + public void setLoginTimeout(int seconds) throws SQLException { + } + + /** + * See {@link javax.sql.DataSource#getLoginTimeout}. + */ + public int getLoginTimeout() { + return 0; + } + + /** + * Closes the connection pool. + */ + public void close() { + pool.destroy(); + pool = null; + } + + /** + * Sets the JDBC driver. + * + * @param driver The JDBC driver. e.g. 'com.mysql.jdbc.Driver' + * + * @see #getDriver() + */ + public void setDriver(String driver) { + this.driver = driver; + } + + /** + * Gets the JDBC driver. + * + * @return The JDBC driver string. + * + * @see #setDriver(String) + */ + public String getDriver() { + return driver; + } + + /** + * Sets the JDBC connect string. + * + * @param jdbcUrl The JDBC connection URL string. e.g. 'jdbc:mysql://localhost:3306/dbname' + * + * @see #getJdbcUrl() + */ + public void setJdbcUrl(String jdbcUrl) { + this.jdbcUrl = jdbcUrl; + } + + /** + * Gets the JDBC connect string. + * + * @return The JDBC connection URL string. + * + * @see #setJdbcUrl(String) + */ + public String getJdbcUrl() { + return jdbcUrl; + } + + /** + * Sets the database login name. + * + * @param user The database login name. e.g. 'Scott' + * + * @see #getUser() + */ + public void setUser(String user) { + this.user = user; + } + + /** + * Gets the database login name. + * + * @return The login name string. + * + * @see #setUser(String) + */ + public String getUser() { + return user; + } + + /** + * Sets the database password. + * + * @param password The database password. e.g. 'Tiger' + * + * @see #getPassword() + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * Gets the database password. + * + * @return The password string. + * + * @see #setPassword(String) + */ + public String getPassword() { + return password; + } + + /** + * Sets the minimum number of connections to start with. + * + * @param minConns The minimum number of connections. + * + * @see #getMinConns() + */ + public void setMinConns(String minConns) { + this.minConns = minConns; + } + + /** + * Gets the minimum number of connections to start with. + * + * @return The minimum number of connections string. + * + * @see #setMinConns(String) + */ + public String getMinConns() { + return minConns; + } + + /** + * Sets the maximum number of connections in dynamic pool. + * + * @param maxConns The maximum number of connections. + * + * @see #getMaxConns() + */ + public void setMaxConns(String maxConns) { + this.maxConns = maxConns; + } + + /** + * Gets the maximum number of connections in dynamic pool. + * + * @return The maximum number of connection string. + * + * @see #setMaxConns(String) + */ + public String getMaxConns() { + return maxConns; + } + + /** + * Sets the time in days between connection resets. + * + * @param maxConnTime The maximum connection time. + * + * @see #getMaxConnTime() + */ + public void setMaxConnTime(String maxConnTime) { + this.maxConnTime = maxConnTime; + } + + /** + * Gets the time in days between connection resets. + * + * @return The maximum connection time string. + * + * @see #setMaxConnTime(String) + */ + public String getMaxConnTime() { + return maxConnTime; + } + + /** + * Sets the max time a connection can be checked out before being recycled. + * + * @param maxCheckoutSeconds The maximum number of seconds to wait before recycling a connection. + * + * @see #getMaxCheckoutSeconds() + */ + public void setMaxCheckoutSeconds(String maxCheckoutSeconds) { + this.maxCheckoutSeconds = maxCheckoutSeconds; + } + + /** + * Gets the max time a connection can be checked out before being recycled. + * + * @return The maximum checkout time string. + * + * @see #setMaxCheckoutSeconds(String) + */ + public String getMaxCheckoutSeconds() { + return maxCheckoutSeconds; + } + } \ No newline at end of file diff --git a/src/net/java/dev/simplepool/SimplePoolDataSourceFactory.java b/src/net/java/dev/simplepool/SimplePoolDataSourceFactory.java index ce845f3..659df5e 100644 --- a/src/net/java/dev/simplepool/SimplePoolDataSourceFactory.java +++ b/src/net/java/dev/simplepool/SimplePoolDataSourceFactory.java @@ -1,141 +1,141 @@ -/* - * $Source$ - * $Revision$ - * $Date$ - * - * Copyright (c) 2004, Russell Beattie (http://www.russellbeattie.com/) - * All rights reserved. - * - * Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the authors nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR - * 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. - */ -package net.java.dev.simplepool; - -import javax.naming.Context; -import javax.naming.Name; -import javax.naming.Reference; -import javax.naming.spi.ObjectFactory; -import java.util.Hashtable; - -/** - * JNDI object factory that creates an instance of {@link SimplePoolDataSource}. - * - * @author Russell Beattie - * @author Erik C. Thauvin - * @version $Revision$, $Date$ - * @since 1.0 - */ -public class SimplePoolDataSourceFactory implements ObjectFactory { - /** - * Creates a {@link SimplePoolDataSource} instance. - * - * @param obj The object containing location or reference information that is used in creating the - * DataSource. - * @param name The name of this object relative to ctx, or null if no name is specified. - * @param ctx The context relative to which the name parameter is specified, or null if - * name is relative to the default initial context. - * @param env The possibly null environment that is used in creating the DataSource. - * - * @return The DataSource; null if it cannot be created. - * - * @throws Exception if the factory encountered an exception while attempting to create the DataSource, - * and no other object factories are to be tried. - */ - public Object getObjectInstance(Object obj, Name name, Context ctx, Hashtable env) - throws Exception { - - Reference ref = (Reference) obj; - SimplePoolDataSource dataSource = new SimplePoolDataSource(); - - /* - driver: JDBC driver. e.g. 'oracle.jdbc.driver.OracleDriver'
                                  - jdbcUrl: JDBC connect string. e.g. 'jdbc:oracle:thin:@203.92.21.109:1526:orcl'
                                  - user: Database login name. e.g. 'Scott'
                                  - password: Database password. e.g. 'Tiger'
                                  - minConns: Minimum number of connections to start with.
                                  - maxConns: Maximum number of connections in dynamic pool.
                                  - maxConnTime: Time in days between connection resets. (Reset does a basic cleanup)
                                  - maxCheckoutSeconds: Max time a connection can be checked out before being recycled. Zero value turns option - off, default is 60 seconds. - */ - - String driver = (String) ref.get("driver").getContent(); - - if (driver != null) { - dataSource.setDriver(driver); - } - - String user = (String) ref.get("user").getContent(); - - if (user != null) { - dataSource.setUser(user); - } - - String password = (String) ref.get("password").getContent(); - - if (password != null) { - dataSource.setPassword(password); - } - - String jdbcUrl = (String) ref.get("jdbcUrl").getContent(); - - if (jdbcUrl != null) { - dataSource.setJdbcUrl(jdbcUrl); - } - - String minConns = (String) ref.get("minConns").getContent(); - - if (minConns != null) { - dataSource.setMinConns(minConns); - } - - String maxConns = (String) ref.get("maxConns").getContent(); - - if (maxConns != null) { - dataSource.setMaxConns(maxConns); - } - - String maxConnTime = (String) ref.get("maxConnTime").getContent(); - - if (maxConnTime != null) { - dataSource.setMaxConnTime(maxConnTime); - } - - String maxCheckoutSeconds = (String) ref.get("maxCheckoutSeconds").getContent(); - - if (maxCheckoutSeconds != null) { - dataSource.setMaxCheckoutSeconds(maxCheckoutSeconds); - } - - dataSource.init(); - - return dataSource; - } +/* + * $Source: /home/cvsroot/manywhere/simplepool/src/net/java/dev/simplepool/SimplePoolDataSourceFactory.java,v $ + * $Revision: 1.5 $ + * $Date: 2004/03/17 23:19:02 $ + * + * Copyright (c) 2004, Russell Beattie (http://www.russellbeattie.com/) + * All rights reserved. + * + * Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the authors nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR + * 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. + */ +package net.java.dev.simplepool; + +import javax.naming.Context; +import javax.naming.Name; +import javax.naming.Reference; +import javax.naming.spi.ObjectFactory; +import java.util.Hashtable; + +/** + * JNDI object factory that creates an instance of {@link SimplePoolDataSource}. + * + * @author Russell Beattie + * @author Erik C. Thauvin + * @version $Revision: 1.5 $, $Date: 2004/03/17 23:19:02 $ + * @since 1.0 + */ +public class SimplePoolDataSourceFactory implements ObjectFactory { + /** + * Creates a {@link SimplePoolDataSource} instance. + * + * @param obj The object containing location or reference information that is used in creating the + * DataSource. + * @param name The name of this object relative to ctx, or null if no name is specified. + * @param ctx The context relative to which the name parameter is specified, or null if + * name is relative to the default initial context. + * @param env The possibly null environment that is used in creating the DataSource. + * + * @return The DataSource; null if it cannot be created. + * + * @throws Exception if the factory encountered an exception while attempting to create the DataSource, + * and no other object factories are to be tried. + */ + public Object getObjectInstance(Object obj, Name name, Context ctx, Hashtable env) + throws Exception { + + Reference ref = (Reference) obj; + SimplePoolDataSource dataSource = new SimplePoolDataSource(); + + /* + driver: JDBC driver. e.g. 'oracle.jdbc.driver.OracleDriver'
                                  + jdbcUrl: JDBC connect string. e.g. 'jdbc:oracle:thin:@203.92.21.109:1526:orcl'
                                  + user: Database login name. e.g. 'Scott'
                                  + password: Database password. e.g. 'Tiger'
                                  + minConns: Minimum number of connections to start with.
                                  + maxConns: Maximum number of connections in dynamic pool.
                                  + maxConnTime: Time in days between connection resets. (Reset does a basic cleanup)
                                  + maxCheckoutSeconds: Max time a connection can be checked out before being recycled. Zero value turns option + off, default is 60 seconds. + */ + + String driver = (String) ref.get("driver").getContent(); + + if (driver != null) { + dataSource.setDriver(driver); + } + + String user = (String) ref.get("user").getContent(); + + if (user != null) { + dataSource.setUser(user); + } + + String password = (String) ref.get("password").getContent(); + + if (password != null) { + dataSource.setPassword(password); + } + + String jdbcUrl = (String) ref.get("jdbcUrl").getContent(); + + if (jdbcUrl != null) { + dataSource.setJdbcUrl(jdbcUrl); + } + + String minConns = (String) ref.get("minConns").getContent(); + + if (minConns != null) { + dataSource.setMinConns(minConns); + } + + String maxConns = (String) ref.get("maxConns").getContent(); + + if (maxConns != null) { + dataSource.setMaxConns(maxConns); + } + + String maxConnTime = (String) ref.get("maxConnTime").getContent(); + + if (maxConnTime != null) { + dataSource.setMaxConnTime(maxConnTime); + } + + String maxCheckoutSeconds = (String) ref.get("maxCheckoutSeconds").getContent(); + + if (maxCheckoutSeconds != null) { + dataSource.setMaxCheckoutSeconds(maxCheckoutSeconds); + } + + dataSource.init(); + + return dataSource; + } } \ No newline at end of file diff --git a/src/net/java/dev/simplepool/SimplePoolServlet.java b/src/net/java/dev/simplepool/SimplePoolServlet.java index 098e629..7946ee4 100644 --- a/src/net/java/dev/simplepool/SimplePoolServlet.java +++ b/src/net/java/dev/simplepool/SimplePoolServlet.java @@ -1,141 +1,141 @@ -/* - * $Source$ - * $Revision$ - * $Date$ - * - * Copyright (c) 2004, Russell Beattie (http://www.russellbeattie.com/) - * All rights reserved. - * - * Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the authors nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR - * 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. - */ -package net.java.dev.simplepool; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; - - -/** - * Creates a pool of database connection based on the specific intialization parameters. - * - * @author Russell Beattie - * @author Erik C. Thauvin - * @version $Revision$, $Date$ - * @since 1.0 - */ -public class SimplePoolServlet extends HttpServlet { - - private static final Log log = LogFactory.getLog(SimplePoolServlet.class); - private static SimplePoolDataSource dataSource; - - /** - * Closes the connection pool. - * - * @see javax.servlet.http.HttpServlet#destroy - */ - public void destroy() { - if (dataSource != null) { - dataSource.close(); - } - } - - /** - * Initializes the connection pool. - *

                                  - * The required intialization parameters are: - *

                                  - *

                                    - *
                                  • varName – Name of the variable used to hold a reference to the - * {@link SimplePoolDataSource}.
                                  • - *
                                  • driver – JDBC driver. e.g. 'oracle.jdbc.driver.OracleDriver'
                                  • - *
                                  • jdbcUrl – JDBC connect string. e.g. 'jdbc:oracle:thin:@203.92.21.109:1526:orcl'
                                  • - *
                                  • user – Database login name. e.g. 'Scott'
                                  • - *
                                  • password – Database password. e.g. 'Tiger'
                                  • - *
                                  • minConns – Minimum number of connections to start with.
                                  • - *
                                  • maxConns – Maximum number of connections in dynamic pool.
                                  • - *
                                  • maxConnTime – Time in days between connection resets.
                                  • - *
                                  • maxCheckoutSeconds – Max time a connection can be checked out before being recycled.
                                  • - *
                                  - * - * @see javax.servlet.http.HttpServlet#init(ServletConfig) - */ - public void init(ServletConfig servletConfig) - throws ServletException { - log.info("Initializing " + servletConfig.getServletName() + " Servlet"); - - String varName = servletConfig.getInitParameter("varName"); - String driver = servletConfig.getInitParameter("driver"); - String jdbcUrl = servletConfig.getInitParameter("jdbcUrl"); - String user = servletConfig.getInitParameter("user"); - String password = servletConfig.getInitParameter("password"); - String minConns = servletConfig.getInitParameter("minConns"); - String maxConns = servletConfig.getInitParameter("maxConns"); - String maxConnTime = servletConfig.getInitParameter("maxConnTime"); - String maxCheckoutSeconds = servletConfig.getInitParameter("maxCheckoutSeconds"); - - if (isValid(varName) && isValid(driver) && isValid(jdbcUrl) && (user != null) && (password != null) - && isValid(minConns) && isValid(maxConns) && isValid(maxConnTime) && isValid(maxCheckoutSeconds)) { - dataSource = new SimplePoolDataSource(); - - dataSource.setDriver(driver); - dataSource.setJdbcUrl(jdbcUrl); - dataSource.setUser(user); - dataSource.setPassword(password); - dataSource.setMinConns(minConns); - dataSource.setMaxConns(maxConns); - dataSource.setMaxConnTime(maxConnTime); - dataSource.setMaxCheckoutSeconds(maxCheckoutSeconds); - - try { - dataSource.init(); - - servletConfig.getServletContext().setAttribute(varName, dataSource); - } catch (Exception e) { - log.error("An error occurred while starting the connection pool.", e); - throw new ServletException("Error starting the connection pool."); - } - } else { - log.error("One or more intialization parameter is invalid or missing."); - throw new ServletException("Invalid or missing initialization parameter."); - } - } - - private boolean isValid(String s) { - if ((s != null) && (s.length() > 0)) { - return true; - } - - return false; - } -} +/* + * $Source: /home/cvsroot/manywhere/simplepool/src/net/java/dev/simplepool/SimplePoolServlet.java,v $ + * $Revision: 1.5 $ + * $Date: 2004/03/17 23:35:36 $ + * + * Copyright (c) 2004, Russell Beattie (http://www.russellbeattie.com/) + * All rights reserved. + * + * Copyright (c) 2004, Erik C. Thauvin (http://www.thauvin.net/erik/) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the authors nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR + * 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. + */ +package net.java.dev.simplepool; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; + + +/** + * Creates a pool of database connection based on the specific intialization parameters. + * + * @author Russell Beattie + * @author Erik C. Thauvin + * @version $Revision: 1.5 $, $Date: 2004/03/17 23:35:36 $ + * @since 1.0 + */ +public class SimplePoolServlet extends HttpServlet { + + private static final Log log = LogFactory.getLog(SimplePoolServlet.class); + private static SimplePoolDataSource dataSource; + + /** + * Closes the connection pool. + * + * @see javax.servlet.http.HttpServlet#destroy + */ + public void destroy() { + if (dataSource != null) { + dataSource.close(); + } + } + + /** + * Initializes the connection pool. + *

                                  + * The required intialization parameters are: + *

                                  + *

                                    + *
                                  • varName – Name of the variable used to hold a reference to the + * {@link SimplePoolDataSource}.
                                  • + *
                                  • driver – JDBC driver. e.g. 'oracle.jdbc.driver.OracleDriver'
                                  • + *
                                  • jdbcUrl – JDBC connect string. e.g. 'jdbc:oracle:thin:@203.92.21.109:1526:orcl'
                                  • + *
                                  • user – Database login name. e.g. 'Scott'
                                  • + *
                                  • password – Database password. e.g. 'Tiger'
                                  • + *
                                  • minConns – Minimum number of connections to start with.
                                  • + *
                                  • maxConns – Maximum number of connections in dynamic pool.
                                  • + *
                                  • maxConnTime – Time in days between connection resets.
                                  • + *
                                  • maxCheckoutSeconds – Max time a connection can be checked out before being recycled.
                                  • + *
                                  + * + * @see javax.servlet.http.HttpServlet#init(ServletConfig) + */ + public void init(ServletConfig servletConfig) + throws ServletException { + log.info("Initializing " + servletConfig.getServletName() + " Servlet"); + + String varName = servletConfig.getInitParameter("varName"); + String driver = servletConfig.getInitParameter("driver"); + String jdbcUrl = servletConfig.getInitParameter("jdbcUrl"); + String user = servletConfig.getInitParameter("user"); + String password = servletConfig.getInitParameter("password"); + String minConns = servletConfig.getInitParameter("minConns"); + String maxConns = servletConfig.getInitParameter("maxConns"); + String maxConnTime = servletConfig.getInitParameter("maxConnTime"); + String maxCheckoutSeconds = servletConfig.getInitParameter("maxCheckoutSeconds"); + + if (isValid(varName) && isValid(driver) && isValid(jdbcUrl) && (user != null) && (password != null) + && isValid(minConns) && isValid(maxConns) && isValid(maxConnTime) && isValid(maxCheckoutSeconds)) { + dataSource = new SimplePoolDataSource(); + + dataSource.setDriver(driver); + dataSource.setJdbcUrl(jdbcUrl); + dataSource.setUser(user); + dataSource.setPassword(password); + dataSource.setMinConns(minConns); + dataSource.setMaxConns(maxConns); + dataSource.setMaxConnTime(maxConnTime); + dataSource.setMaxCheckoutSeconds(maxCheckoutSeconds); + + try { + dataSource.init(); + + servletConfig.getServletContext().setAttribute(varName, dataSource); + } catch (Exception e) { + log.error("An error occurred while starting the connection pool.", e); + throw new ServletException("Error starting the connection pool."); + } + } else { + log.error("One or more intialization parameter is invalid or missing."); + throw new ServletException("Invalid or missing initialization parameter."); + } + } + + private boolean isValid(String s) { + if ((s != null) && (s.length() > 0)) { + return true; + } + + return false; + } +} diff --git a/src/net/java/dev/simplepool/package.html b/src/net/java/dev/simplepool/package.html index e1c1d4f..7137e84 100644 --- a/src/net/java/dev/simplepool/package.html +++ b/src/net/java/dev/simplepool/package.html @@ -1,13 +1,13 @@ - - - - SimplePool API - - -This package contains a simple database connection pool implementation for web applications, specifically those using JSTL. -

                                  -The connection pool can be created, accessed and managed via JNDI or through the {@link net.java.dev.simplepool.SimplePoolServlet}. - -@since 1.0 - - + + + + SimplePool API + + +This package contains a simple database connection pool implementation for web applications, specifically those using JSTL. +

                                  +The connection pool can be created, accessed and managed via JNDI or through the {@link net.java.dev.simplepool.SimplePoolServlet}. + +@since 1.0 + +