Package net.sf.xbus.tools

Source Code of net.sf.xbus.tools.HSQLDBShutdown

/*
* Created on 10.07.2003
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package net.sf.xbus.tools;

import net.sf.xbus.base.core.XException;
import net.sf.xbus.base.core.config.Configuration;
import net.sf.xbus.technical.database.DBConnection;

/**
* @author fleckenstein
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class HSQLDBShutdown
{

  public static void main(String[] args)
  {
    try
    {
      String dbConnectionName = Configuration.getInstance()
          .getValueOptional("Base", "Journal", "DBConnection");
      if (dbConnectionName == null)
      {
        dbConnectionName = DBConnection.UNNAMED;
      }
      DBConnection dbcon = DBConnection.getInstance(dbConnectionName);

      if ((dbcon.getUrl() != null)
          && (dbcon.getUrl().startsWith("jdbc:hsqldb")))
      {
        dbcon.executeUpdate("shutdown compact");
      }
    }
    catch (XException e)
    {
      System.exit(1);
    }

  }
}
TOP

Related Classes of net.sf.xbus.tools.HSQLDBShutdown

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.