~sgdg/stado/stado25

« back to all changes in this revision

Viewing changes to src/org/postgresql/driver/ds/PGPoolingDataSource.java

  • Committer: Jim Mlodgenski
  • Date: 2011-08-30 22:39:37 UTC
  • mfrom: (1.1.3 stado)
  • Revision ID: jim@cirrusql.com-20110830223937-25q231a31x0e08b4
Merge from Spatial branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 * Copyright (C) 2008 EnterpriseDB Corporation.
 
3
 * Copyright (C) 2011 Stado Global Development Group.
 
4
 *
 
5
 * This file is part of Stado.
 
6
 *
 
7
 * Stado is free software: you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation, either version 3 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * Stado is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with Stado.  If not, see <http://www.gnu.org/licenses/>.
 
19
 *
 
20
 * You can find Stado at http://www.stado.us
 
21
 *
 
22
 ****************************************************************************/
 
23
package org.postgresql.driver.ds;
 
24
 
 
25
import javax.sql.DataSource;
 
26
 
 
27
/**
 
28
 * DataSource which uses connection pooling.  <font color="red">Don't use this if
 
29
 * your server/middleware vendor provides a connection pooling implementation
 
30
 * which interfaces with the PostgreSQL ConnectionPoolDataSource implementation!</font>
 
31
 * This class is provided as a convenience, but the JDBC Driver is really not
 
32
 * supposed to handle the connection pooling algorithm.  Instead, the server or
 
33
 * middleware product is supposed to handle the mechanics of connection pooling,
 
34
 * and use the PostgreSQL implementation of ConnectionPoolDataSource to provide
 
35
 * the connections to pool.
 
36
 *
 
37
 * <p>If you're sure you want to use this, then you must set the properties
 
38
 * dataSourceName, databaseName, user, and password (if required for the user).
 
39
 * The settings for serverName, portNumber, initialConnections, and
 
40
 * maxConnections are optional.  Note that <i>only connections
 
41
 * for the default user will be pooled!</i>  Connections for other users will
 
42
 * be normal non-pooled connections, and will not count against the maximum pool
 
43
 * size limit.</p>
 
44
 *
 
45
 * <p>If you put this DataSource in JNDI, and access it from different JVMs (or
 
46
 * otherwise load this class from different ClassLoaders), you'll end up with one
 
47
 * pool per ClassLoader or VM. This is another area where a server-specific
 
48
 * implementation may provide advanced features, such as using a single pool
 
49
 * across all VMs in a cluster.</p>
 
50
 *
 
51
 * <p>This implementation supports JDK 1.3 and higher.</p>
 
52
 *
 
53
 * @author Aaron Mulder (ammulder@chariotsolutions.com)
 
54
 */
 
55
public class PGPoolingDataSource
 
56
    extends org.postgresql.driver.ds.jdbc4.AbstractJdbc4PoolingDataSource
 
57
    implements DataSource
 
58
{
 
59
 
 
60
    protected void addDataSource(String dataSourceName)
 
61
    {
 
62
        dataSources.put(dataSourceName, this);
 
63
    }
 
64
 
 
65
}