yass.database
Class HsqldbDatabase

java.lang.Object
  extended by yass.database.Database
      extended by yass.database.HsqldbDatabase

public class HsqldbDatabase
extends Database

An implementation of a simulation database using the HSQLDB in-memory DBMS for lower-level data storage


Field Summary
private static org.apache.log4j.Logger log
          The logger
 
Fields inherited from class yass.database.Database
analysisMode, connection, dbContainerDirectory, dbName, dbPassword, dbProperties, dbServer, dbTablesFilepath, dbUsername, deleteOnShutdown, driver, dropTablesOnShutdown, eventClasses, generator, protocol, running, statementCommitThreshold, statementCounter, type
 
Constructor Summary
HsqldbDatabase()
          Creates a new instance of HsqldbDatabase using default values for reasonable but untuned performance
HsqldbDatabase(java.lang.String databaseName, java.util.Set<java.lang.Class> eventClasses, int statementCommitThreshold)
          Creates a new instance of HsqldbDatabase
 
Method Summary
protected  void createConnection()
          Creates a connection to the underlying database
protected  java.util.Properties createDbProperties()
          Creates a properties object containing the database parameters supplied by the user and application to HSQLDB during database creation
protected  void setDatabaseProperties()
          Sets dynamic properties on the underlying HSQLDB database to optimise performance
 
Methods inherited from class yass.database.Database
addEventClass, commit, commitIfRequired, createPreparedStatement, createStatement, empty, getConnection, getDbContainerDirectory, getDbDirectory, getDbName, getDbPassword, getDbProperties, getDbServer, getDbUsername, getDeleteOnShutdown, getDropTablesOnShutdown, getEventClasses, getStatementCommitThreshold, getStatementCounter, getType, isAnalysisMode, isRunning, purgeSimulation, rollback, setAnalysisMode, setDeleteOnShutdown, setDropTablesOnShutdown, shutdown, startup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Logger log
The logger

Constructor Detail

HsqldbDatabase

public HsqldbDatabase()
Creates a new instance of HsqldbDatabase using default values for reasonable but untuned performance


HsqldbDatabase

public HsqldbDatabase(java.lang.String databaseName,
                      java.util.Set<java.lang.Class> eventClasses,
                      int statementCommitThreshold)
Creates a new instance of HsqldbDatabase

Parameters:
databaseName - the desired database name to which a random sequence of numbers will be appended automatically
eventClasses - the set of event classes managed by this database
statementCommitThreshold - the maximum number of database-changing actions permitted before a commit is forced automatically
Method Detail

createDbProperties

protected java.util.Properties createDbProperties()
Creates a properties object containing the database parameters supplied by the user and application to HSQLDB during database creation

Returns:
the properties object

setDatabaseProperties

protected void setDatabaseProperties()
                              throws java.sql.SQLException
Sets dynamic properties on the underlying HSQLDB database to optimise performance

Specified by:
setDatabaseProperties in class Database
Throws:
java.sql.SQLException - if the properies cannot be set

createConnection

protected void createConnection()
                         throws java.sql.SQLException
Creates a connection to the underlying database

Specified by:
createConnection in class Database
Throws:
java.sql.SQLException - if the connection cannot be created