org.postgresql.ds.jdbc23
Class AbstractJdbc23ConnectionPoolDataSource

java.lang.Object
  extended by org.postgresql.ds.common.BaseDataSource
      extended by org.postgresql.ds.jdbc23.AbstractJdbc23ConnectionPoolDataSource
All Implemented Interfaces:
Serializable, Referenceable
Direct Known Subclasses:
AbstractJdbc4ConnectionPoolDataSource

public class AbstractJdbc23ConnectionPoolDataSource
extends BaseDataSource
implements Serializable

PostgreSQL implementation of ConnectionPoolDataSource. The app server or middleware vendor should provide a DataSource implementation that takes advantage of this ConnectionPoolDataSource. If not, you can use the PostgreSQL implementation known as PoolingDataSource, but that should only be used if your server or middleware vendor does not provide their own. Why? The server may want to reuse the same Connection across all EJBs requesting a Connection within the same Transaction, or provide other similar advanced features.

In any case, in order to use this ConnectionPoolDataSource, you must set the property databaseName. The settings for serverName, portNumber, user, and password are optional. Note: these properties are declared in the superclass.

This implementation supports JDK 1.3 and higher.

Author:
Aaron Mulder (ammulder@chariotsolutions.com)
See Also:
Serialized Form

Constructor Summary
AbstractJdbc23ConnectionPoolDataSource()
           
 
Method Summary
 String getDescription()
          Gets a description of this DataSource.
 PooledConnection getPooledConnection()
          Gets a connection which may be pooled by the app server or middleware implementation of DataSource.
 PooledConnection getPooledConnection(String user, String password)
          Gets a connection which may be pooled by the app server or middleware implementation of DataSource.
 boolean isDefaultAutoCommit()
          Gets whether connections supplied by this pool will have autoCommit turned on by default.
 void setDefaultAutoCommit(boolean defaultAutoCommit)
          Sets whether connections supplied by this pool will have autoCommit turned on by default.
 
Methods inherited from class org.postgresql.ds.common.BaseDataSource
createReference, getApplicationName, getCompatible, getConnection, getConnection, getDatabaseName, getLoginTimeout, getLogLevel, getLogWriter, getPassword, getPortNumber, getPrepareThreshold, getProtocolVersion, getReference, getServerName, getSocketTimeout, getSsl, getSslfactory, getTcpKeepAlive, getUnknownLength, getUser, initializeFrom, readBaseObject, setApplicationName, setCompatible, setDatabaseName, setLoginTimeout, setLogLevel, setLogWriter, setPassword, setPortNumber, setPrepareThreshold, setProtocolVersion, setServerName, setSocketTimeout, setSsl, setSslfactory, setTcpKeepAlive, setUnknownLength, setUser, writeBaseObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJdbc23ConnectionPoolDataSource

public AbstractJdbc23ConnectionPoolDataSource()
Method Detail

getDescription

public String getDescription()
Gets a description of this DataSource.

Specified by:
getDescription in class BaseDataSource

getPooledConnection

public PooledConnection getPooledConnection()
                                     throws SQLException
Gets a connection which may be pooled by the app server or middleware implementation of DataSource.

Throws:
SQLException - Occurs when the physical database connection cannot be established.

getPooledConnection

public PooledConnection getPooledConnection(String user,
                                            String password)
                                     throws SQLException
Gets a connection which may be pooled by the app server or middleware implementation of DataSource.

Throws:
SQLException - Occurs when the physical database connection cannot be established.

isDefaultAutoCommit

public boolean isDefaultAutoCommit()
Gets whether connections supplied by this pool will have autoCommit turned on by default. The default value is false, so that autoCommit will be turned off by default.


setDefaultAutoCommit

public void setDefaultAutoCommit(boolean defaultAutoCommit)
Sets whether connections supplied by this pool will have autoCommit turned on by default. The default value is false, so that autoCommit will be turned off by default.



Copyright © 2013. All Rights Reserved.