org.exolab.jms.tools.db
Class DBTool

java.lang.Object
  |
  +--org.exolab.jms.tools.db.DBTool

public class DBTool
extends java.lang.Object

This class provides support for creating and destroying OpenJMS tables in RDBMS databases.

Version:
$Revision: 1.4 $ $Date: 2005/11/12 12:47:37 $
Author:
Tim Anderson

Constructor Summary
DBTool(org.exolab.jms.config.Configuration config)
          Construct a new DBTool.
DBTool(java.lang.String path)
          Construct an instance with the path to an openjms XML configuration file.
 
Method Summary
 void close()
          Deallocate any resources.
 void create()
          Creates the database tables using the default schema.
 void create(java.lang.String path)
          Creates the database tables from the specified schema.
 void delete()
          Deletes all data from the database tables.
 void drop()
          Drop the database tables from the default schema.
 void drop(java.lang.String path)
          Drop the database tables from the specified schema.
static void main(java.lang.String[] args)
           
 void migrate()
          Migrates the database tables to the latest version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBTool

public DBTool(org.exolab.jms.config.Configuration config)
       throws org.exolab.jms.persistence.PersistenceException
Construct a new DBTool.
Parameters:
config - the configuration to use.
Throws:
org.exolab.jms.persistence.PersistenceException - for any error

DBTool

public DBTool(java.lang.String path)
       throws org.exolab.jms.persistence.PersistenceException
Construct an instance with the path to an openjms XML configuration file.
Parameters:
path - the path to an openjms XML configuration file
Throws:
org.exolab.jms.persistence.PersistenceException - if a connection cannot be established
Method Detail

create

public void create()
            throws org.exolab.jms.persistence.PersistenceException
Creates the database tables using the default schema.
Throws:
org.exolab.jms.persistence.PersistenceException - if the tables cannot be created

create

public void create(java.lang.String path)
            throws org.exolab.jms.persistence.PersistenceException
Creates the database tables from the specified schema.
Parameters:
path - the path to an XML database schema file
Throws:
org.exolab.jms.persistence.PersistenceException - if the tables cannot be created

drop

public void drop()
          throws org.exolab.jms.persistence.PersistenceException
Drop the database tables from the default schema.
Throws:
org.exolab.jms.persistence.PersistenceException - if the tables cannot be dropped

drop

public void drop(java.lang.String path)
          throws org.exolab.jms.persistence.PersistenceException
Drop the database tables from the specified schema.
Parameters:
path - the path to an XML database schema file
Throws:
org.exolab.jms.persistence.PersistenceException - if the tables cannot be dropped

delete

public void delete()
            throws org.exolab.jms.persistence.PersistenceException
Deletes all data from the database tables.
Throws:
org.exolab.jms.persistence.PersistenceException - if the tables can't be deleted

migrate

public void migrate()
             throws org.exolab.jms.persistence.PersistenceException
Migrates the database tables to the latest version.
Throws:
org.exolab.jms.persistence.PersistenceException - if the database cannot be migrated

close

public void close()
           throws java.sql.SQLException
Deallocate any resources.
Throws:
java.sql.SQLException - if the database connection cannot be closed

main

public static void main(java.lang.String[] args)


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.