pl.kernelpanic.dbmonster
Class SchemaGrabber

java.lang.Object
  extended by pl.kernelpanic.dbmonster.SchemaGrabber

public class SchemaGrabber
extends Object

Schema Grabber.

Version:
$Id: SchemaGrabber.java,v 1.3 2006/01/05 16:29:37 majek Exp $
Author:
Piotr Maj <pm@jcake.com>

Constructor Summary
SchemaGrabber()
          Constructs new SchemaGrabber.
 
Method Summary
 void addTable(String name)
          Adds a table names to the list of grabbed tables.
 void doTheJob()
          Starts schema grabber.
 ConnectionProvider getConnectionProvider()
          Returns a connection provider used by the grabber.
 Log getLog()
          Returns the logger.
 OutputStream getOutput()
          Returns the output stream where the serialized schema should be pushed.
 Vector getTableNames()
          Returns names of the tables in the database.
 Schema grabSchema()
          Grabs the schema.
 Table grabTable(String name)
          Grabs the table.
static void main(String[] args)
          Starts SchemaGrabber
 void setConnectionProvider(ConnectionProvider provider)
          Sets the connection provider.
 void setLog(Log logger)
          Sets the logger
 void setOutputFile(String file)
          Sets the output file name.
 void setProperties(Properties p)
          Sets the properties for the SchemaGrabber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaGrabber

public SchemaGrabber()
Constructs new SchemaGrabber.

Method Detail

main

public static void main(String[] args)
                 throws Exception
Starts SchemaGrabber

Parameters:
args - command line arguments
Throws:
Exception - on errors

doTheJob

public void doTheJob()
              throws Exception
Starts schema grabber.

Throws:
Exception - on errors

getOutput

public OutputStream getOutput()
Returns the output stream where the serialized schema should be pushed.

Returns:
output stream

grabSchema

public Schema grabSchema()
                  throws Exception
Grabs the schema.

Returns:
Schema schema
Throws:
Exception - on errors

grabTable

public Table grabTable(String name)
                throws SQLException,
                       SchemaException
Grabs the table.

Parameters:
name - table name
Returns:
table
Throws:
SQLException - on SQL errors
SchemaException - on schema errors

getTableNames

public Vector getTableNames()
                     throws SQLException
Returns names of the tables in the database.

Returns:
vector of strings
Throws:
SQLException - on errors

getConnectionProvider

public ConnectionProvider getConnectionProvider()
Returns a connection provider used by the grabber.

Returns:
connection provider instance

setConnectionProvider

public void setConnectionProvider(ConnectionProvider provider)
Sets the connection provider.

Parameters:
provider - connection provider

getLog

public Log getLog()
Returns the logger.

Returns:
logger

setLog

public void setLog(Log logger)
Sets the logger

Parameters:
logger - new logger

addTable

public void addTable(String name)
              throws SQLException
Adds a table names to the list of grabbed tables.

Parameters:
name - name of the table
Throws:
SQLException - if table cannot be found

setOutputFile

public void setOutputFile(String file)
                   throws IOException
Sets the output file name.

Parameters:
file - file name
Throws:
IOException - on I/O errors

setProperties

public void setProperties(Properties p)
Sets the properties for the SchemaGrabber

Parameters:
p -


Copyright © 2003-2006 .:. kernelpanic.pl .:.. All Rights Reserved.