Top Description Fields Constructors Methods
org.apache.derby.jdbc

public Class BasicClientConnectionPoolDataSource40

extends BasicClientDataSource40
implements ConnectionPoolDataSource, ClientConnectionPoolDataSourceInterface
Class Inheritance
All Implemented Interfaces
org.apache.derby.client.ClientConnectionPoolDataSourceInterface, javax.sql.ConnectionPoolDataSource, javax.sql.CommonDataSource, org.apache.derby.client.ClientDataSourceInterface, javax.sql.DataSource, java.sql.Wrapper
Imports
java.io.IOException, .ObjectInputStream, java.sql.SQLException, javax.sql.ConnectionPoolDataSource, .PooledConnection, org.apache.derby.shared.common.i18n.MessageUtil, org.apache.derby.shared.common.reference.MessageId, org.apache.derby.client.ClientConnectionPoolDataSourceInterface

This data source is suitable for client/server use of Derby, running on Java 8 Compact Profile 2 or higher.

BasicClientConnectionPoolDataSource40 is similar to ClientConnectionPoolDataSource except that it does not support JNDI, i.e. it does not implement javax.naming.Referenceable.

See Also
ClientConnectionPoolDataSource40

Field Summary

Modifier and TypeField and Description
public static final String
private int
maxStatements

Specifies the maximum number of statements that can be cached per connection by the JDBC driver.

private static final MessageUtil
msgUtil

Message utility used to obtain localized messages.

private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

Maximum number of statements to cache, or 0 if caching is disabled (default).
getMaxStatements
()

Implements org.apache.derby.client.ClientConnectionPoolDataSourceInterface.getMaxStatements.

Returns the maximum number of JDBC prepared statements a connection is allowed to cache.
public PooledConnection
getPooledConnection()

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempts to establish a physical database connection that can be used as a pooled connection.
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.

Attempts to establish a physical database connection that can be used as a pooled connection.
public int
private void
readObject(ObjectInputStream
data stream to read objects from
inputStream
)

Read an object from the ObjectInputStream.

public void
setMaxStatements(int
maximum number of cached statements
maxStatements
)

Implements org.apache.derby.client.ClientConnectionPoolDataSourceInterface.setMaxStatements.

Specifies the maximum size of the statement cache.
private final void
validateState()

Make sure the state of the de-serialized object is valid.

Field Detail

className__back to summary
public static final String className__

Hides org.apache.derby.client.BasicClientDataSource.className__.

maxStatementsback to summary
private int maxStatements

Specifies the maximum number of statements that can be cached per connection by the JDBC driver.

A value of 0 disables statement caching, negative values are not allowed. The default is that caching is disabled.

msgUtilback to summary
private static final MessageUtil msgUtil

Message utility used to obtain localized messages.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.derby.jdbc.BasicClientDataSource40.serialVersionUID.

Constructor Detail

BasicClientConnectionPoolDataSource40back to summary
public BasicClientConnectionPoolDataSource40()

Method Detail

getMaxStatementsback to summary
public int getMaxStatements()

Implements org.apache.derby.client.ClientConnectionPoolDataSourceInterface.getMaxStatements.

Returns the maximum number of JDBC prepared statements a connection is allowed to cache.

Returns:int

Maximum number of statements to cache, or 0 if caching is disabled (default).

getPooledConnectionback to summary
public PooledConnection getPooledConnection() throws SQLException

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Doc from javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempts to establish a physical database connection that can be used as a pooled connection.

Returns:PooledConnection

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

Exceptions
SQLException:
if a database access error occurs
See Also
javax.sql.ConnectionPoolDataSource#getPooledConnection()
getPooledConnectionback to summary
public PooledConnection getPooledConnection(String user, String password) throws SQLException

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Doc from javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempts to establish a physical database connection that can be used as a pooled connection.

Parameters
user:String

the database user on whose behalf the connection is being made

password:String

the user's password

Returns:PooledConnection

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

Exceptions
SQLException:
if a database access error occurs
See Also
javax.sql.ConnectionPoolDataSource#getPooledConnection(java.lang.String, java.lang.String)
maxStatementsToPoolback to summary
public int maxStatementsToPool()

Overrides org.apache.derby.client.BasicClientDataSource.maxStatementsToPool.

Internally used method.

Returns:int

Doc from org.apache.derby.client.BasicClientDataSource.maxStatementsToPool.

Maximum number of statements to cache, or 0 if caching is disabled (default).

See Also
BasicClientDataSource40#maxStatementsToPool
readObjectback to summary
private void readObject(ObjectInputStream inputStream) throws ClassNotFoundException, IOException

Read an object from the ObjectInputStream.

This implementation differs from the default one by initiating state validation of the object created.

Parameters
inputStream:ObjectInputStream

data stream to read objects from

Exceptions
ClassNotFoundException:
if instantiating a class fails
IOException:
if reading from the stream fails
setMaxStatementsback to summary
public void setMaxStatements(int maxStatements)

Implements org.apache.derby.client.ClientConnectionPoolDataSourceInterface.setMaxStatements.

Specifies the maximum size of the statement cache.

Parameters
maxStatements:int

maximum number of cached statements

Exceptions
IllegalArgumentException:
if maxStatements is negative
validateStateback to summary
private final void validateState()

Make sure the state of the de-serialized object is valid.