org.scubatoolkit.db
Class Database

java.lang.Object
  |
  +--org.scubatoolkit.db.Database

public class Database
extends java.lang.Object

Author:
Javier Vilalta *

Field Summary
static Database instance
           
private  java.lang.String[] tableNames
           
 
Constructor Summary
private Database()
           
 
Method Summary
 void clear()
           
 void create()
          Creates the database
 void delete()
           
 boolean exists()
           
private  java.lang.String getCreateSQL()
           
 java.lang.String getSchemaVersion()
           
 void updateSchema()
          Updates the database to the current schema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static Database instance

tableNames

private final java.lang.String[] tableNames
Constructor Detail

Database

private Database()
Method Detail

exists

public boolean exists()
               throws java.lang.ClassNotFoundException,
                      java.sql.SQLException
Returns:
Returns true if the database exists
java.lang.ClassNotFoundException
java.sql.SQLException

getSchemaVersion

public java.lang.String getSchemaVersion()
                                  throws java.lang.ClassNotFoundException,
                                         java.sql.SQLException
Returns:
Returns the version number of the database schema
java.lang.ClassNotFoundException
java.sql.SQLException

create

public void create()
            throws java.lang.ClassNotFoundException,
                   java.sql.SQLException,
                   java.io.IOException,
                   java.net.URISyntaxException
Creates the database

java.lang.ClassNotFoundException
java.sql.SQLException
java.io.IOException
java.net.URISyntaxException

getCreateSQL

private java.lang.String getCreateSQL()
                               throws java.io.IOException,
                                      java.net.URISyntaxException
java.io.IOException
java.net.URISyntaxException

updateSchema

public void updateSchema()
Updates the database to the current schema


clear

public void clear()
           throws java.lang.ClassNotFoundException,
                  java.sql.SQLException
java.lang.ClassNotFoundException
java.sql.SQLException

delete

public void delete()
            throws java.lang.ClassNotFoundException,
                   java.sql.SQLException
java.lang.ClassNotFoundException
java.sql.SQLException


Copyright © 2002 The Scuba Toolkit Team. All Rights Reserved.