uk.ac.ic.doc.automed.reps
Class RelationalOutputter

java.lang.Object
  extended by uk.ac.ic.doc.automed.reps.RelationalOutputter

public class RelationalOutputter
extends java.lang.Object

Class the materialise an SQL oriented AutoMed schema

Author:
Andrew Smith - acs203

Constructor Summary
RelationalOutputter(AutoMedPeer peer, Schema schema)
          Creates a new instance of RelationalOutputter with a default output directory for use with an AutoMed peer
RelationalOutputter(Schema schema)
          Creates a new instance of RelationalOutputter with a default output directory
RelationalOutputter(Schema source, Schema s, java.lang.String dbDriver, java.lang.String url, java.lang.String username, java.lang.String password)
          Creates a new instance of RelationalOutputter with a given DB url, username and password
 
Method Summary
 void connectToDB()
          Connect to the local database
 java.lang.String createRelationalTables()
          Create the relational tables from the automed schema objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationalOutputter

public RelationalOutputter(Schema schema)
                    throws AutoMedException
Creates a new instance of RelationalOutputter with a default output directory

Throws:
AutoMedException

RelationalOutputter

public RelationalOutputter(AutoMedPeer peer,
                           Schema schema)
                    throws AutoMedException
Creates a new instance of RelationalOutputter with a default output directory for use with an AutoMed peer

Throws:
AutoMedException

RelationalOutputter

public RelationalOutputter(Schema source,
                           Schema s,
                           java.lang.String dbDriver,
                           java.lang.String url,
                           java.lang.String username,
                           java.lang.String password)
                    throws AutoMedException
Creates a new instance of RelationalOutputter with a given DB url, username and password

Parameters:
source - The source schema
s - The schema to be materialised
dbDriver - The db driver string
xmlDoc - Whether or not there is a XML instance document
url - The url of the output database
username - The username to log into the target db
password - The password to log into the output db
Throws:
AutoMedException - Thrown when theres a problem
Method Detail

createRelationalTables

public java.lang.String createRelationalTables()
                                        throws AutoMedException,
                                               java.lang.Exception
Create the relational tables from the automed schema objects

Returns:
Return the SQL statement string
Throws:
java.lang.Exception - A SQL problem
AutoMedException - A repository problem

connectToDB

public void connectToDB()
Connect to the local database