public final class ArchiveDBConnection extends Object
The statements to create the tables are in scripts/sql/createBitpreservationDB.sql
The implementation relies on a connection pool. Once acquired through the get() method, a connection must be explicitly returned to the pool by calling the release(Connection) method.
THis class is intended to be used statically, and hence cannot be instantiated and is final.
Modifier and Type | Method and Description |
---|---|
static void |
cleanup()
Closes the underlying data source.
|
static Connection |
get()
Get a connection to the harvest definition database from the pool.
|
static String |
getArchiveUrl()
Method for retrieving the url for the archive database.
|
static void |
release(Connection connection)
Helper method to return a connection to the pool.
|
public static Connection get()
ArchiveSettings.DB_POOL_MIN_SIZE
ArchiveSettings.DB_POOL_MAX_SIZE
ArchiveSettings.DB_POOL_ACQ_INC
release(Connection)
.IOFailure
- if we cannot connect to the database (or find the driver).public static void cleanup()
public static void release(Connection connection)
connection
- a connectionpublic static String getArchiveUrl()
Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.