Top Description Fields Constructors Methods
org.postgresql.ds

public Class PGConnectionPoolDataSource

extends BaseDataSource
implements ConnectionPoolDataSource, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.sql.ConnectionPoolDataSource, javax.sql.CommonDataSource
Known Direct Subclasses
org.postgresql.jdbc2.optional.ConnectionPool, org.postgresql.jdbc3.Jdbc3ConnectionPool
Imports
org.postgresql.ds.common.BaseDataSource, org.postgresql.util.DriverInfo, java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serializable, java.sql.SQLException, javax.sql.ConnectionPoolDataSource, .PooledConnection

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 ([email protected])

Field Summary

Modifier and TypeField and Description
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getDescription()

Implements abstract org.postgresql.ds.common.BaseDataSource.getDescription.

Gets a description of this DataSource.

public PooledConnection
getPooledConnection()

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Gets a connection which may be pooled by the app server or middleware implementation of DataSource.

public PooledConnection
getPooledConnection(String
the database user on whose behalf the connection is being made
user
,
String
the user's password
password
)

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Gets a connection which may be pooled by the app server or middleware implementation of DataSource.

public boolean

Returns:

true if connections supplied by this pool will have autoCommit
isDefaultAutoCommit
()

Gets whether connections supplied by this pool will have autoCommit turned on by default.

private void
public void
setDefaultAutoCommit(boolean
whether connections supplied by this pool will have autoCommit
defaultAutoCommit
)

Sets whether connections supplied by this pool will have autoCommit turned on by default.

private void
Inherited from org.postgresql.ds.common.BaseDataSource:
createReferencegetAdaptiveFetchgetAdaptiveFetchMaximumgetAdaptiveFetchMinimumgetAllowEncodingChangesgetApplicationNamegetAssumeMinServerVersiongetAuthenticationPluginClassNamegetAutosavegetBinaryTransfergetBinaryTransferDisablegetBinaryTransferEnablegetCancelSignalTimeoutgetCleanupSavepointsgetConnectiongetConnectiongetConnectTimeoutgetCurrentSchemagetDatabaseMetadataCacheFieldsgetDatabaseMetadataCacheFieldsMiBgetDatabaseNamegetDefaultRowFetchSizegetDisableColumnSanitisergetEscapeSyntaxCallModegetGroupStartupParametersgetGssEncModegetGssLibgetGssResponseTimeoutgetHideUnprivilegedObjectsgetHostRecheckSecondsgetJaasApplicationNamegetJaasLogingetKerberosServerNamegetLoadBalanceHostsgetLocalSocketAddressgetLoggerFilegetLoggerLevelgetLoginTimeoutgetLogServerErrorDetailgetLogUnclosedConnectionsgetLogWritergetMaxResultBuffergetOptionsgetParentLoggergetPasswordgetPortNumbergetPortNumbersgetPreferQueryModegetPreparedStatementCacheQueriesgetPreparedStatementCacheSizeMiBgetPrepareThresholdgetPropertygetPropertygetProtocolVersiongetQuoteReturningIdentifiersgetReadOnlygetReadOnlyModegetReceiveBufferSizegetRecvBufferSizegetReferencegetReplicationgetReWriteBatchedInsertsgetSendBufferSizegetServerNamegetServerNamesgetSocketFactorygetSocketFactoryArggetSocketTimeoutgetSslgetSslCertgetSslcertgetSslfactorygetSslFactoryArggetSslfactoryarggetSslHostnameVerifiergetSslhostnameverifiergetSslKeygetSslkeygetSslModegetSslmodegetSslPasswordgetSslpasswordgetSslPasswordCallbackgetSslpasswordcallbackgetSslResponseTimeoutgetSslRootCertgetSslrootcertgetSspiServiceClassgetStringTypegetTargetServerTypegetTcpKeepAlivegetTcpNoDelaygetUnknownLengthgetUrlgetURLgetUsergetUseSpNegogetXmlFactoryFactoryinitializeFromisAllowEncodingChangesisCleanupSavePointsisColumnSanitiserDisabledisDisableColumnSanitiserisLoadBalanceHostsisLogUnclosedConnectionsisReadOnlyisReWriteBatchedInsertsisSslisTcpKeepAlivereadBaseObjectsetAdaptiveFetchsetAdaptiveFetchMaximumsetAdaptiveFetchMinimumsetAllowEncodingChangessetApplicationNamesetAssumeMinServerVersionsetAuthenticationPluginClassNamesetAutosavesetBinaryTransfersetBinaryTransferDisablesetBinaryTransferEnablesetCancelSignalTimeoutsetCleanupSavepointssetCleanupSavePointssetConnectTimeoutsetCurrentSchemasetDatabaseMetadataCacheFieldssetDatabaseMetadataCacheFieldsMiBsetDatabaseNamesetDefaultRowFetchSizesetDisableColumnSanitisersetEscapeSyntaxCallModesetFromReferencesetGroupStartupParameterssetGssEncModesetGssLibsetGssResponseTimeoutsetHideUnprivilegedObjectssetHostRecheckSecondssetJaasApplicationNamesetJaasLoginsetKerberosServerNamesetLoadBalanceHostssetLocalSocketAddresssetLoggerFilesetLoggerLevelsetLoginTimeoutsetLogServerErrorDetailsetLogUnclosedConnectionssetLogWritersetMaxResultBuffersetOptionssetPasswordsetPortNumbersetPortNumberssetPreferQueryModesetPreparedStatementCacheQueriessetPreparedStatementCacheSizeMiBsetPrepareThresholdsetPropertysetPropertysetProtocolVersionsetQuoteReturningIdentifierssetReadOnlysetReadOnlyModesetReceiveBufferSizesetRecvBufferSizesetReplicationsetReWriteBatchedInsertssetSendBufferSizesetServerNamesetServerNamessetSocketFactorysetSocketFactoryArgsetSocketTimeoutsetSslsetSslCertsetSslcertsetSslfactorysetSslFactoryArgsetSslfactoryargsetSslHostnameVerifiersetSslhostnameverifiersetSslKeysetSslkeysetSslModesetSslmodesetSslPasswordsetSslpasswordsetSslPasswordCallbacksetSslpasswordcallbacksetSslResponseTimeoutsetSslRootCertsetSslrootcertsetSspiServiceClasssetStringTypesetTargetServerTypesetTcpKeepAlivesetTcpNoDelaysetUnknownLengthsetUrlsetURLsetUsersetUseSpNegosetXmlFactoryFactorywriteBaseObject

Field Detail

defaultAutoCommitback to summary
private boolean defaultAutoCommit

Constructor Detail

PGConnectionPoolDataSourceback to summary
public PGConnectionPoolDataSource()

Method Detail

getDescriptionback to summary
public String getDescription()

Implements abstract org.postgresql.ds.common.BaseDataSource.getDescription.

Gets a description of this DataSource.

Returns:String

Doc from org.postgresql.ds.common.BaseDataSource.getDescription.

description of this DataSource-ish thing

Annotations
@Override
getPooledConnectionback to summary
public PooledConnection getPooledConnection() throws SQLException

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Gets a connection which may be pooled by the app server or middleware implementation of DataSource.

Returns:PooledConnection

Doc from javax.sql.ConnectionPoolDataSource.getPooledConnection.

a PooledConnection object that is a physical connection to the database that this ConnectionPoolDataSource object represents

Annotations
@Override
Exceptions
SQLException:
Occurs when the physical database connection cannot be established.
getPooledConnectionback to summary
public PooledConnection getPooledConnection(String user, String password) throws SQLException

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Gets a connection which may be pooled by the app server or middleware implementation of DataSource.

Parameters
user:String

Doc from javax.sql.ConnectionPoolDataSource.getPooledConnection.

the database user on whose behalf the connection is being made

password:String

Doc from javax.sql.ConnectionPoolDataSource.getPooledConnection.

the user's password

Returns:PooledConnection

Doc from javax.sql.ConnectionPoolDataSource.getPooledConnection.

a PooledConnection object that is a physical connection to the database that this ConnectionPoolDataSource object represents

Annotations
@Override
Exceptions
SQLException:
Occurs when the physical database connection cannot be established.
isDefaultAutoCommitback to summary
public boolean isDefaultAutoCommit()

Gets whether connections supplied by this pool will have autoCommit turned on by default. The default value is true, so that autoCommit will be turned on by default.

Returns:boolean

true if connections supplied by this pool will have autoCommit

readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
setDefaultAutoCommitback to summary
public void setDefaultAutoCommit(boolean defaultAutoCommit)

Sets whether connections supplied by this pool will have autoCommit turned on by default. The default value is true, so that autoCommit will be turned on by default.

Parameters
defaultAutoCommit:boolean

whether connections supplied by this pool will have autoCommit

writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException