pl.kernelpanic.dbmonster
Class SchemaGrabber

java.lang.Object
  extended bypl.kernelpanic.dbmonster.SchemaGrabber

public class SchemaGrabber
extends Object

Schema Grabber.

Version:
$Id: SchemaGrabber.html,v 1.1 2007/06/21 08:38:14 sbahloul Exp $
Author:
Piotr Maj <piotr.maj@kernelpanic.pl>

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 final void doTheJob()
                    throws Exception
Starts schema grabber.

Throws:
Exception - on errors

getOutput

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

Returns:
output stream

grabSchema

public final Schema grabSchema()
                        throws Exception
Grabs the schema.

Returns:
Schema schema
Throws:
Exception - on errors

grabTable

public final 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 final Vector getTableNames()
                           throws SQLException
Returns names of the tables in the database.

Returns:
vector of strings
Throws:
SQLException - on errors

getConnectionProvider

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

Returns:
connection provider instance

setConnectionProvider

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

Parameters:
provider - connection provider

getLog

public final Log getLog()
Returns the logger.

Returns:
logger

setLog

public final void setLog(Log logger)
Sets the logger

Parameters:
logger - new logger

addTable

public final 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 final void setOutputFile(String file)
                         throws IOException
Sets the output file name.

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

setProperties

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

Parameters:
p -


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