|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.harvester.datamodel.HarvestDBConnection
public final class HarvestDBConnection
This class handles connections to the harvest definition database, and also defines basic logic for checking versions of tables. The statements to create the tables are located in:
Method Summary | |
---|---|
static void |
cleanup()
Closes the underlying data source. |
static java.sql.Connection |
get()
Get a connection to the harvest definition database from the pool. |
static java.lang.String |
getDBUrl()
Method for retrieving the url for the harvest definition database. |
static void |
release(java.sql.Connection connection)
Helper method to return a connection to the pool. |
static void |
updateTable(java.sql.Connection c,
java.lang.String table,
int newVersion,
java.lang.String... updates)
|
protected static void |
updateTable(java.lang.String table,
int newVersion,
java.lang.String... updates)
Update a table by executing all the statements in the updates String array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.sql.Connection get()
CommonSettings.DB_POOL_MIN_SIZE
CommonSettings.DB_POOL_MAX_SIZE
CommonSettings.DB_POOL_ACQ_INC
release(Connection)
.
IOFailure
- if we cannot connect to the database (or find the
driver).protected static void updateTable(java.lang.String table, int newVersion, java.lang.String... updates)
table
- The table to updatenewVersion
- The version that the table should end up atupdates
- The SQL update statements that makes the necessary
updates.
IOFailure
- in case of problems in interacting with the databasepublic static void updateTable(java.sql.Connection c, java.lang.String table, int newVersion, java.lang.String... updates)
public static java.lang.String getDBUrl()
public static void cleanup()
public static void release(java.sql.Connection connection)
connection
- a connection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |