java.lang.Object
com.aoapps.dbc.Database
com.aoapps.dbc.CloseableDatabase
- All Implemented Interfaces:
DatabaseAccess
,AutoCloseable
Allows closing of the underlying pool. This is useful in application life cycle management, such as shutting down
a database as a web application is being destroyed.
The component that creates the database should generally be responsible for closing it. To make it evident that the
rest of the application should not close the database, only the Database
base type should be provided.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.aoapps.dbc.DatabaseAccess
DatabaseAccess.Null
-
Constructor Summary
ConstructorDescriptionCloseableDatabase
(String driver, String url, String user, String password, int numConnections, long maxConnectionAge, Logger logger) CloseableDatabase
(DataSource dataSource, Logger logger) -
Method Summary
Methods inherited from class com.aoapps.dbc.Database
connect, createDatabaseConnection, deinitConnection, deinitSqlDataTypes, doubleStream, executeTransaction, executeTransaction, executeTransaction, executeTransaction, getConnection, getConnection, getConnection, getConnection, getConnection, getConnection, getConnectionPool, getDataSource, getLogger, initConnection, initSqlDataTypes, intStream, isInTransaction, largeUpdate, longStream, queryCall, release, releaseConnection, stream, toString, transactionCall, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.aoapps.dbc.DatabaseAccess
doubleStream, doubleStreamUpdate, executeBigDecimalQuery, executeBigDecimalQuery, executeBigDecimalUpdate, executeBooleanQuery, executeBooleanQuery, executeBooleanUpdate, executeByteArrayQuery, executeByteArrayQuery, executeByteArrayUpdate, executeDateQuery, executeDateQuery, executeDateUpdate, executeIntListQuery, executeIntListQuery, executeIntListUpdate, executeIntQuery, executeIntQuery, executeIntUpdate, executeLongListQuery, executeLongListQuery, executeLongListUpdate, executeLongQuery, executeLongQuery, executeLongUpdate, executeObjectCollectionQuery, executeObjectCollectionQuery, executeObjectCollectionQuery, executeObjectCollectionQuery, executeObjectCollectionQuery, executeObjectCollectionQuery, executeObjectCollectionUpdate, executeObjectCollectionUpdate, executeObjectCollectionUpdate, executeObjectListQuery, executeObjectListQuery, executeObjectListQuery, executeObjectListQuery, executeObjectListQuery, executeObjectListQuery, executeObjectListUpdate, executeObjectListUpdate, executeObjectListUpdate, executeObjectQuery, executeObjectQuery, executeObjectQuery, executeObjectQuery, executeObjectQuery, executeObjectQuery, executeObjectUpdate, executeObjectUpdate, executeObjectUpdate, executeQuery, executeQuery, executeQuery, executeQuery, executeShortListQuery, executeShortListQuery, executeShortListUpdate, executeShortQuery, executeShortQuery, executeShortUpdate, executeStringListQuery, executeStringListQuery, executeStringListUpdate, executeStringQuery, executeStringQuery, executeStringUpdate, executeTimestampQuery, executeTimestampQuery, executeTimestampUpdate, executeUpdate, executeUpdate, executeUpdate, intStream, intStreamUpdate, longStream, longStreamUpdate, queryBigDecimal, queryBigDecimal, queryBigDecimal, queryBigDecimalNullable, queryBigDecimalOptional, queryBigDecimalOptionalNullable, queryBoolean, queryBoolean, queryBoolean, queryBooleanNullable, queryBooleanOptional, queryBooleanOptionalNullable, queryByteArray, queryByteArray, queryByteArray, queryByteArrayNullable, queryByteArrayOptional, queryByteArrayOptionalNullable, queryCall, queryCall, queryCall, queryCollection, queryCollection, queryCollection, queryCollection, queryDate, queryDate, queryDate, queryDateNullable, queryDateOptional, queryDateOptionalNullable, queryDouble, queryDouble, queryDouble, queryDoubleNullable, queryDoubleOptional, queryDoubleOptionalNullable, queryFloat, queryFloat, queryFloat, queryFloatNullable, queryFloatOptional, queryFloatOptionalNullable, queryInt, queryInt, queryInt, queryIntList, queryIntList, queryIntNullable, queryIntOptional, queryIntOptionalNullable, queryList, queryList, queryList, queryList, queryLong, queryLong, queryLong, queryLongList, queryLongList, queryLongNullable, queryLongOptional, queryLongOptionalNullable, queryNewCollection, queryNewCollection, queryNewCollection, queryNewCollection, queryObject, queryObject, queryObject, queryObject, queryObject, queryObject, queryObjectNullable, queryObjectNullable, queryObjectOptional, queryObjectOptional, queryObjectOptionalNullable, queryObjectOptionalNullable, queryRun, queryRun, queryRun, queryRun, queryShort, queryShort, queryShort, queryShortNullable, queryShortOptional, queryShortOptionalNullable, queryString, queryString, queryString, queryStringList, queryStringList, queryStringNullable, queryStringOptional, queryStringOptionalNullable, queryTimestamp, queryTimestamp, queryTimestamp, queryTimestampNullable, queryTimestampOptional, queryTimestampOptionalNullable, stream, stream, stream, streamOptional, streamOptional, streamOptional, streamOptional, streamOptionalUpdate, streamOptionalUpdate, streamString, streamString, streamStringUpdate, streamUpdate, streamUpdate, transactionCall, transactionCall, transactionCall, transactionRun, transactionRun, transactionRun, transactionRun, updateBigDecimal, updateBigDecimalNullable, updateBigDecimalOptional, updateBigDecimalOptionalNullable, updateBoolean, updateBooleanNullable, updateBooleanOptional, updateBooleanOptionalNullable, updateByteArray, updateByteArrayNullable, updateByteArrayOptional, updateByteArrayOptionalNullable, updateCall, updateCall, updateCollection, updateCollection, updateDate, updateDateNullable, updateDateOptional, updateDateOptionalNullable, updateDouble, updateDoubleNullable, updateDoubleOptional, updateDoubleOptionalNullable, updateFloat, updateFloatNullable, updateFloatOptional, updateFloatOptionalNullable, updateInt, updateIntList, updateIntNullable, updateIntOptional, updateIntOptionalNullable, updateList, updateList, updateLong, updateLongList, updateLongNullable, updateLongOptional, updateLongOptionalNullable, updateNewCollection, updateNewCollection, updateObject, updateObject, updateObjectNullable, updateObjectNullable, updateObjectOptional, updateObjectOptional, updateObjectOptionalNullable, updateObjectOptionalNullable, updateRun, updateRun, updateShort, updateShortNullable, updateShortOptional, updateShortOptionalNullable, updateString, updateStringList, updateStringNullable, updateStringOptional, updateStringOptionalNullable, updateTimestamp, updateTimestampNullable, updateTimestampOptional, updateTimestampOptionalNullable
-
Constructor Details
-
CloseableDatabase
-
CloseableDatabase
-
CloseableDatabase
-
-
Method Details
-
close
public void close()Closes the database.- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classDatabase
- See Also:
-