HSQLDB-Specific Information:
A connection pool for HyperSQL connections. This implementation ofDataSource is dedicated to HyperSQL and
guarantees all connection states are automatically reset when a connection
is reused.
The methods of the parent class,
JDBCCommonDataSource are used to specify the database URL, user,
password, and / or connection properties.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static interface |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile boolean | |
| pack-priv JDBCPooledConnection[] | |
| pack-priv JDBCPooledDataSource | |
| pack-priv AtomicIntegerArray |
| Access | Constructor and Description |
|---|---|
| public | |
| public | JDBCPool(int
int maximum size of the pool size)Creates a connection pool with the given maximum size. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close(int
int number of seconds to wait before closing the connections, maximum 60 seconds wait)Closes the pool immediately. |
| public void | connectionClosed(ConnectionEvent event)
Implements javax. Notifies this |
| public void | connectionErrorOccurred(ConnectionEvent event)
Implements javax. Notifies this |
| public Connection | Returns: a connection to the data sourceImplements javax. Retrieves a new connection using the properties that have already been set. |
| public Connection | Returns: a connection to the data sourcethe database user on whose behalf the connection is
being made username, String the user's password password)Implements javax. Retrieves a new connection using the given username and password, and the database url that has been set. |
| public String | |
| public String | |
| public String | |
| public String | |
| public int | Returns: the data source login time limitImplements javax. Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. |
| public PrintWriter | Returns: the log writer for this data source or null if logging is disabledImplements javax. Retrieves the log writer for this |
| public Logger | Returns: the parent Logger for this data sourceImplements javax. Return the parent Logger of all the Loggers used by this data source. |
| public Reference | Returns: The non-null Reference of this object.Implements javax. Retrieves the Reference of this object. |
| public String | Returns: the jdbc database connection url attributeRetrieves the jdbc database connection url attribute. |
| public String | Returns: the jdbc database connection url attributeRetrieves the jdbc database connection url attribute. |
| public String | |
| public boolean | Returns: true if this implements the interface or directly or indirectly wraps an object that does.a Class defining an interface. iface)Implements java. Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. |
| public void | |
| public void | |
| public void | setLoginTimeout(int
the data source login time limit seconds)Implements javax. Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. |
| public void | setLogWriter(PrintWriter
the new log writer; to disable logging, set to null out)Implements javax. Sets the log writer for this |
| public void | |
| public void | setProperties(Properties
properties. If null, then existing properties will be
cleared/replaced. props)Sets connection properties. |
| public void | |
| public void | |
| public void | |
| public void | statementClosed(StatementEvent event)
Implements javax. The driver calls this method on all |
| public void | statementErrorOccurred(StatementEvent event)
Implements javax. The driver calls this method on all |
| public <T> T | Returns: an object that implements the interface. May be a proxy for the actual implementing object.A Class defining an interface that the result must implement. iface)Implements java. Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. |
| closed | back to summary |
|---|---|
| pack-priv volatile boolean closed | |
| connections | back to summary |
|---|---|
| pack-priv JDBCPooledConnection[] connections | |
| source | back to summary |
|---|---|
| pack-priv JDBCPooledDataSource source | |
| states | back to summary |
|---|---|
| pack-priv AtomicIntegerArray states | |
| JDBCPool | back to summary |
|---|---|
| public JDBCPool() Creates a connection pool with the maximum size of 8. The database and
connection settings are made before the | |
| JDBCPool | back to summary |
|---|---|
| public JDBCPool(int size) Creates a connection pool with the given maximum size. The database and
connection settings are made before the
| |
| close | back to summary |
|---|---|
| public void close(int wait) throws SQLException Closes the pool immediately. Waits the given number of seconds before closing all existing connections in the pool.
| |
| connectionClosed | back to summary |
|---|---|
| public void connectionClosed(ConnectionEvent event) Implements javax. Doc from javax. Notifies this | |
| connectionErrorOccurred | back to summary |
|---|---|
| public void connectionErrorOccurred(ConnectionEvent event) Implements javax. Doc from javax. Notifies this | |
| getConnection | back to summary |
|---|---|
| public Connection getConnection() throws SQLException Implements javax. Retrieves a new connection using the properties that have already been set.
| |
| getConnection | back to summary |
|---|---|
| public Connection getConnection(String username, String password) throws SQLException Implements javax. Retrieves a new connection using the given username and password, and the database url that has been set. No other properties are used for the connection. This method can be used only with the same username and password used for the connection pool. The first call to this method sets the user name and password for the connection pool.
| |
| getDatabase | back to summary |
|---|---|
| public String getDatabase() Synonym for getUrl().
| |
| getDatabaseName | back to summary |
|---|---|
| public String getDatabaseName() Synonym for getUrl().
| |
| getDataSourceName | back to summary |
|---|---|
| public String getDataSourceName() Retrieves the name of the data source.
| |
| getDescription | back to summary |
|---|---|
| public String getDescription() Retrieves the description of the data source.
| |
| getLoginTimeout | back to summary |
|---|---|
| public int getLoginTimeout() throws SQLException Implements javax. Gets the maximum time in seconds that this data source can wait
while attempting to connect to a database. A value of zero
means that the timeout is the default system timeout
if there is one; otherwise, it means that there is no timeout.
When a
| |
| getLogWriter | back to summary |
|---|---|
| public PrintWriter getLogWriter() throws SQLException Implements javax. Retrieves the log writer for this The log writer is a character output stream to which all logging
and tracing messages for this data source will be
printed. This includes messages printed by the methods of this
object, messages printed by methods of other objects manufactured
by this object, and so on. Messages printed to a data source
specific log writer are not printed to the log writer associated
with the
| |
| getParentLogger | back to summary |
|---|---|
| public Logger getParentLogger() throws SQLFeatureNotSupportedException Implements javax. Return the parent Logger of all the Loggers used by this data source. This should be the Logger farthest from the root Logger that is still an ancestor of all of the Loggers used by this data source. Configuring this Logger will affect all of the log messages generated by the data source. In the worst case, this may be the root Logger.
| |
| getReference | back to summary |
|---|---|
| public Reference getReference() throws NamingException Implements javax. Retrieves the Reference of this object.
| |
| getUrl | back to summary |
|---|---|
| public String getUrl() Retrieves the jdbc database connection url attribute.
| |
| getURL | back to summary |
|---|---|
| public String getURL() Retrieves the jdbc database connection url attribute.
| |
| getUser | back to summary |
|---|---|
| public String getUser() Retrieves the user name for the connection.
| |
| isWrapperFor | back to summary |
|---|---|
| public boolean isWrapperFor(Class<?> iface) throws SQLException Implements java. Returns true if this either implements the interface argument or is directly or indirectly a wrapper
for an object that does. Returns false otherwise. If this implements the interface then return true,
else if this is a wrapper then return the result of recursively calling
| |
| setDatabase | back to summary |
|---|---|
| public void setDatabase(String database) Synonym for setUrl(String).
| |
| setDatabaseName | back to summary |
|---|---|
| public void setDatabaseName(String databaseName) Synonym for setUrl(String).
| |
| setLoginTimeout | back to summary |
|---|---|
| public void setLoginTimeout(int seconds) throws SQLException Implements javax. Sets the maximum time in seconds that this data source will wait
while attempting to connect to a database. A value of zero
specifies that the timeout is the default system timeout
if there is one; otherwise, it specifies that there is no timeout.
When a
| |
| setLogWriter | back to summary |
|---|---|
| public void setLogWriter(PrintWriter out) throws SQLException Implements javax. Sets the log writer for this The log writer is a character output stream to which all logging
and tracing messages for this data source will be
printed. This includes messages printed by the methods of this
object, messages printed by methods of other objects manufactured
by this object, and so on. Messages printed to a data source-
specific log writer are not printed to the log writer associated
with the
| |
| setPassword | back to summary |
|---|---|
| public void setPassword(String password) Sets the password for the username.
| |
| setProperties | back to summary |
|---|---|
| public void setProperties(Properties props) Sets connection properties. If user / password / loginTimeout has been set with one of the setXXX() methods it will be added to the Properties object.
| |
| setUrl | back to summary |
|---|---|
| public void setUrl(String url) Sets the jdbc database URL.
| |
| setURL | back to summary |
|---|---|
| public void setURL(String url) Sets the jdbc database URL.
| |
| setUser | back to summary |
|---|---|
| public void setUser(String user) Sets the user name.
| |
| statementClosed | back to summary |
|---|---|
| public void statementClosed(StatementEvent event) Implements javax. Doc from javax. The driver calls this method on all | |
| statementErrorOccurred | back to summary |
|---|---|
| public void statementErrorOccurred(StatementEvent event) Implements javax. Doc from javax. The driver calls this method on all | |
| unwrap | back to summary |
|---|---|
| public <T> T unwrap(Class<T> iface) throws SQLException Implements java. Returns an object that implements the given interface to allow access to
non-standard methods, or standard methods not exposed by the proxy.
If the receiver implements the interface then the result is the receiver
or a proxy for the receiver. If the receiver is a wrapper
and the wrapped object implements the interface then the result is the
wrapped object or a proxy for the wrapped object. Otherwise return the
result of calling
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final int | |
| public static final int |
| allocated | back to summary |
|---|---|
| public static final int allocated | |
| available | back to summary |
|---|---|
| public static final int available | |
| empty | back to summary |
|---|---|
| public static final int empty | |