net.sf.borg.model.db.jdbc
Class JdbcDBUpgrader

java.lang.Object
  extended by net.sf.borg.model.db.jdbc.JdbcDBUpgrader

public class JdbcDBUpgrader
extends Object

Class JdbcDBUpgrader is used to upgrade HSQL database in-place when the schema changes for a release. This class will check an update condition, and if true, execute SQL to upgrade the DB. It is meant to be called during model initialization - preferably from the constructors of the JdbcDB classes


Constructor Summary
JdbcDBUpgrader(String checkSql, String usql)
          Instantiates a new jdbc db upgrader.
JdbcDBUpgrader(String checkSql, String[] usql)
          Instantiates a new jdbc db upgrader.
 
Method Summary
 void upgrade()
          run the upgrade check and then upgrade if needed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcDBUpgrader

public JdbcDBUpgrader(String checkSql,
                      String usql)
Instantiates a new jdbc db upgrader.

Parameters:
checkSql - the sql that checks if an upgrade is needed
usql - the sql to upgrade the db if needed

JdbcDBUpgrader

public JdbcDBUpgrader(String checkSql,
                      String[] usql)
Instantiates a new jdbc db upgrader.

Parameters:
checkSql - the sql that checks if an upgrade is needed
usql - an array of SQL statements to execute to perform the upgrade
Method Detail

upgrade

public void upgrade()
run the upgrade check and then upgrade if needed



Generated December 30 2011 by mbb using Apache Ant(TM) version 1.8.2 compiled on December 20 2010 and Java version 1.6.0_30 from Sun Microsystems Inc. on Linux i386 3.0.0-14-generic-pae