PooledConnectionDataSource
- Last Updated: June 20, 2019
- 1 minute read
- DataDirect Connectors
- JDBC
- Aha! 6.0
- Amazon Redshift 6.0
- Apache Cassandra 6.0
- Apache Hive 6.0
- Apache Spark SQL 6.0
- Atlassian Jira 6.0
- Autonomous REST Connector 6.0
- Cloudera Impala 5.1
- + 24
The PooledConnectionDataSource
interface is used to create a PooledConnectionDataSource object for use with the DataDirect Connection
Pool Manager.
PooledConnectionDataSource Methods |
Description |
|---|---|
void
close() |
Closes the connection pool. All physical connections in the pool are closed. Any subsequent connection request re-initializes the connection pool. |
Connection
getConnection() |
Obtains a physical connection from the connection pool. |
Connection
getConnection(String user, String
password) |
Obtains a physical connection from the connection pool, where user is the user requesting the connection and password is the password for the connection. |
String
getDataSourceName() |
Returns the JNDI name that is used to look
up the DataSource object referenced by
this PooledConnectionDataSource. |
String
getDescription() |
Returns the description of this PooledConnectionDataSource. |
String
getReauthentication() |
Returns whether the Pool Manager is enabled for reauthentication. See "Using Reauthentication with the Pool Manager" for more information. |
int
getInitialPoolSize() |
Returns the value of the initial pool size, which is the number of physical connections created when the connection pool is initialized. |
int
getLoginTimeout() |
Returns the value of the login timeout, which is the time allowed for the database login to be validated. |
PrintWriter
getLogWriter() |
Returns the writer to which the Pool Manager sends trace information about its activities. |
int
getMaxIdleTime() |
Returns the value of the maximum idle time, which is the time a physical connection can remain idle in the connection pool before it is removed from the connection pool. |
int
getMaxPoolSize() |
Returns the value of the maximum pool size. See "Configuring the maximum pool size" for more information about how the Pool Manager implements the maximum pool size. In addition, see "Using Reauthentication with the Pool Manager" |
int
getMaxPoolSizeBehavior() |
Returns the value of the maximum pool size behavior. See "Configuring the maximum pool size" for more information about how the Pool Manager implements the maximum pool size. |
int
getMinPoolSize() |
Returns the value of the minimum pool size, which is the minimum number of idle connections to be kept in the pool. |
int
getPropertyCycle() |
Returns the value of the property cycle, which specifies how often the pool maintenance thread wakes up and checks the connection pool. |
Reference
getReference() |
Obtains a javax.naming. Reference object for this PooledConnectionDataSource. The Reference
object contains all the state information needed to recreate an instance of
this data source using the PooledConnectionDataSourceFactory object. This method is
typically called by a JNDI service provider when this PooledConnectionDataSource is bound to a JNDI
naming service. |
public static
ConnectionPoolMonitor[ ] getMonitor() |
Returns an array of Connection Pool Monitors, one for each connection pool managed by the Pool Manager. |
public static
ConnectionPoolMonitor getMonitor(String name) |
Returns the name of the Connection Pool
Monitor for the connection pool specified by name. If a pool with the specified name cannot be found, this
method returns null. The connection pool name has the form:
where:
|
boolean
isTracing() |
Determines whether tracing is enabled. If
enabled, tracing information is sent to the PrintWriter that is passed to the setLogWriter() method or the standard output System.out if the setLogWriter() method is not called. |
void
setDataSourceName(String dataSourceName) |
Sets the JNDI name, which is used to look up
the driver DataSource object referenced by
this PooledConnectionDataSource. The
driver DataSource object bound to this
PooledConnectionDataSource, specified
by dataSourceName, is not persisted. Any
changes made to the PooledConnectionDataSource bound to the specified driver
DataSource object affect this PooledConnectionDataSource. |
void
setDataSourceName(String dataSourceName, ConnectionPoolDataSource dataSource) |
Sets the JNDI name associated with this
PooledConnectionDataSource, specified
by dataSourceName, and the driver DataSource object, specified by dataSource, referenced by this PooledConnectionDataSource. The driver |
void
setDataSourceName(String dataSourceName, Context ctx) |
Sets the JNDI name, specified by dataSourceName, and context, specified by
ctx, to be used to look up the driver
DataSource referenced by this PooledConnectionDataSource. The JNDI name, specified by dataSourceName, and context, specified by ctx, are used to look up a driver |
void
setDescription(String description) |
Sets the description of the PooledConnectionDataSource, where description is the description. |
void
setInitialPoolSize(int initialPoolSize) |
Sets the value of the initial pool size, which is the number of connections created when the connection pool is initialized. |
void
setLoginTimeout(int i) |
Sets the value of the login timeout, where i is the login timeout, which is the time allowed for the database login to be validated. |
void
setLogTimestamp(boolean value) |
If set to true, the timestamp is logged when DataDirect Spy logging is
enabled. If set to false, the timestamp is
not logged. |
void
setLogTname(boolean value) |
If set to true, the thread name is logged when DataDirect Spy logging is
enabled. If set to false, the thread name
is not logged. |
void
setLogWriter(PrintWriter printWriter) |
Sets the writer, where printWriter is the writer to which the stream will be printed. |
void
setMaxIdleTime(int maxIdleTime) |
Sets the value in seconds of the maximum idle time, which is the time a connection can remain unused in the connection pool before it is closed and removed from the pool. Zero (0) indicates no limit. |
void
setMaxPoolSize(int maxPoolSize) |
Sets the value of the maximum pool size, which is the maximum number of connections for each user allowed in the pool. See "Configuring the maximum pool size" for more information about how the Pool Manager implements the maximum pool size. |
void
setMaxPoolSizeBehavior(String value) |
Sets the value of the maximum pool size
behavior, which is either softCap or
hardCap. If If See "Configuring the maximum pool size" for more information about how the Pool Manager implements the maximum pool size. |
void
setMinPoolSize(int minPoolSize) |
Sets the value of the minimum pool size, which is the minimum number of idle connections to be kept in the connection pool. |
void
setPropertyCycle(int propertyCycle) |
Sets the value in seconds of the property cycle, which specifies how often the pool maintenance thread wakes up and checks the connection pool. |
void
setReauthentication(String value) |
Enables and disables reauthentication for
the Pool Manager. To enable reauthentication, use setReauthentication(enable). To disable reauthentication, use
setReauthentication(disable). See
"Using Reauthentication with the Pool Manager" for more information. |
void
setTracing(boolean value) |
Enables or disables tracing. If set to
true, tracing is enabled; if false, it is disabled. If enabled, tracing
information is sent to the PrintWriter
that is passed to the setLogWriter()
method or the standard output System.out
if the setLogWriter() method is not
called. |