uk.ac.ed.inf.utils.database
Class DbManager
java.lang.Object
uk.ac.ed.inf.utils.database.Manager
uk.ac.ed.inf.utils.database.DbManager
public class DbManager
- extends Manager
A database manager provides object to create a database, write and read from
it. A manager manages the trio: DbCreator to create the tables,
DbReader to read data from and DbWriter to write data to the
database.
- Version:
- 20 Feb 2009
- Author:
- Luna De Ferrari luna.deferrari-at-ed.ac.uk
|
Constructor Summary |
DbManager(java.lang.String dbConnPath)
Constructor 1: creates the database connection and the classes for
reading/writing to database |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_dbWriter
public DbWriter m_dbWriter
- the database recorder
DbManager
public DbManager(java.lang.String dbConnPath)
- Constructor 1: creates the database connection and the classes for
reading/writing to database
closeConnection
public void closeConnection()
connectionIsValid
public boolean connectionIsValid()
getDatabaseName
public java.lang.String getDatabaseName()
getDbConnection
public DbConn getDbConnection()
getDbCreator
public DbCreator getDbCreator()
getDbReader
public DbReader<java.lang.String,java.lang.String> getDbReader()
getDbWriter
public DbWriter getDbWriter()
getTableManager
public TableManager getTableManager(java.lang.String tableName)
getTableManager
public TableManager getTableManager(Table table)
refreshConnection
public void refreshConnection()
runAnalyzeTable
public void runAnalyzeTable()
- Runs the 'ANALYZE TABLE tablename' SQL command for all the tables in a
mysql database. (Refresh indexes etc.) Good for performance.