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

public Class EmbeddedConnectionPoolDataSource

extends EmbeddedDataSource
implements EmbeddedConnectionPoolDataSourceInterface
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.jdbc.EmbeddedConnectionPoolDataSourceInterface, javax.sql.ConnectionPoolDataSource, javax.sql.CommonDataSource, org.apache.derby.iapi.jdbc.EmbeddedDataSourceInterface, javax.sql.DataSource, java.sql.Wrapper
Known Direct Subclasses
org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40
Imports
java.sql.SQLException, javax.sql.PooledConnection, org.apache.derby.iapi.jdbc.EmbeddedConnectionPoolDataSourceInterface, org.apache.derby.impl.jdbc.EmbedPooledConnection

This datasource is suitable for an application using embedded Derby, running on full Java SE 6 and higher, corresponding to 4.0 and higher. EmbeddedConnectionPoolDataSource is a ConnectionPoolDataSource implementation.

A ConnectionPoolDataSource is a factory for PooledConnection objects. An object that implements this interface will typically be registered with a JNDI service.

EmbeddedConnectionPoolDataSource automatically supports the correct JDBC specification version for the Java Virtual Machine's environment.

Use BasicEmbeddedConnectionPoolDataSource40 if your application runs on Java 8 Compact Profile 2.

EmbeddedConnectionPoolDataSource is serializable and referenceable.

See EmbeddedDataSource for DataSource properties.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
EmbeddedConnectionPoolDataSource()

No-arg constructor.

Method Summary

Modifier and TypeMethod and Description
private PooledConnection

Returns:

A pooled connection
createPooledConnection
(String
The user name
user
,
String
The password
password
,
boolean
@false if original call is from a no-argument constructor, otherwise true
requestPassword
)

Create and return an EmbedPooledConnection from this instance of EmbeddedConnectionPoolDataSource.

public final PooledConnection

Returns:

a Connection to the database
getPooledConnection
()

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempt to establish a database connection.
public final PooledConnection

Returns:

a Connection to the database
getPooledConnection
(String
the database user on whose behalf the Connection is being made
username
,
String
the user's password
password
)

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempt to establish a database connection.
Inherited from org.apache.derby.jdbc.EmbeddedDataSource:
getObjectInstancegetReference

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.derby.jdbc.EmbeddedDataSource.serialVersionUID.

Constructor Detail

EmbeddedConnectionPoolDataSourceback to summary
public EmbeddedConnectionPoolDataSource()

No-arg constructor.

Method Detail

createPooledConnectionback to summary
private PooledConnection createPooledConnection(String user, String password, boolean requestPassword) throws SQLException

Create and return an EmbedPooledConnection from this instance of EmbeddedConnectionPoolDataSource.

Parameters
user:String

The user name

password:String

The password

requestPassword:boolean

@false if original call is from a no-argument constructor, otherwise true

Returns:PooledConnection

A pooled connection

Exceptions
SQLException:
An error occurred
getPooledConnectionback to summary
public final PooledConnection getPooledConnection() throws SQLException

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempt to establish a database connection.

Returns:PooledConnection

a Connection to the database

Annotations
@Override
Exceptions
SQLException:
if a database-access error occurs.
getPooledConnectionback to summary
public final PooledConnection getPooledConnection(String username, String password) throws SQLException

Implements javax.sql.ConnectionPoolDataSource.getPooledConnection.

Attempt to establish a database connection.

Parameters
username:String

the database user on whose behalf the Connection is being made

password:String

the user's password

Returns:PooledConnection

a Connection to the database

Annotations
@Override
Exceptions
SQLException:
if a database-access error occurs.