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.8 $ $Date: 2003/10/28 07:27:29 $
Author:
Tim Anderson

Constructor Summary
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 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(java.lang.String path)
       throws java.lang.ClassNotFoundException,
              ConfigurationFileException,
              FileDoesNotExistException,
              java.io.IOException,
              PersistenceException
Construct an instance with the path to an openjms XML configuration file
Parameters:
path - the path to an openjms XML configuration file
Throws:
java.lang.ClassNotFoundException - if the JDBC driver cannot be loaded
ConfigurationFileException - if the configuration file is invalid
FileDoesNotExistException - if the file cannot be found
java.io.IOException - if the RDBMS configuration contains invalid values for the paths element
java.lang.IllegalArgumentException - if path is null
PersistenceException - if a connection cannot be established
Method Detail

create

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

create

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

drop

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

drop

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

migrate

public void migrate()
             throws PersistenceException
Migrates the database tables to the latest version
Throws:
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-2004 The OpenJMS Group. All Rights Reserved.