Package org.duracloud.common.util
Class DatabaseUtil
java.lang.Object
org.duracloud.common.util.DatabaseUtil
This abstract class provides the ability to create/clear/remove a database and its tables. It also provides a 'javax.sql.DataSource' for the database. Finally, sql operations can be executed on the database through the retrieval of the 'JdbcOperations' object provided by the method: getOps().
- Author:
- Andrew Woods
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDatabaseUtil(Credential cred, String baseDir) DatabaseUtil(Credential cred, String baseDir, String bootPassword) -
Method Summary
-
Field Details
-
log
protected final org.slf4j.Logger log -
NOT_ENCRYPTED
-
-
Constructor Details
-
DatabaseUtil
-
DatabaseUtil
-
-
Method Details
-
getTableSpecs
-
initializeDB
This method sets-up empty tables for this database.- Throws:
Exception
-
ensureDatabaseExists
public void ensureDatabaseExists() -
ensureTablesExist
- Throws:
SQLException
-
clearDB
public void clearDB() -
disconnect
public void disconnect() -
getSimpleJdbcTemplate
public org.springframework.jdbc.core.JdbcTemplate getSimpleJdbcTemplate() -
getDataSource
-
getOps
public org.springframework.jdbc.core.JdbcOperations getOps() -
execute
-