org.apache.torque.engine.database.transform
Class SQLToAppData

java.lang.Object
  extended byorg.apache.torque.engine.database.transform.SQLToAppData

public class SQLToAppData
extends java.lang.Object

A Class that converts an sql input file to an AppData structure. The class makes use of SQL Scanner to get sql tokens and the parses these to create the AppData class. SQLToAppData is in effect a simplified sql parser.

Version:
$Id: SQLToAppData.java,v 1.2.2.2 2004/05/20 04:34:17 seade Exp $
Author:
Leon Messerschmidt, Jon S. Stevens

Constructor Summary
SQLToAppData(java.lang.String sqlFile)
          Create a new class with an input Reader
SQLToAppData(java.lang.String sqlFile, java.lang.String databaseType, java.lang.String basePropsFilePath)
          Create a new class with an input Reader.
 
Method Summary
 AppData execute()
          Execute the parser.
 java.lang.String getSqlFile()
          Get the current input sql file
static void main(java.lang.String[] args)
          Just 4 testing.
 void setSqlFile(java.lang.String sqlFile)
          Set the current input sql file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLToAppData

public SQLToAppData(java.lang.String sqlFile)
Create a new class with an input Reader

Parameters:
sqlFile - the sql file

SQLToAppData

public SQLToAppData(java.lang.String sqlFile,
                    java.lang.String databaseType,
                    java.lang.String basePropsFilePath)
Create a new class with an input Reader. This ctor is not used but putting here in the event db.props properties are found to be useful converting sql to xml, the infrastructure will exist

Parameters:
sqlFile - the sql file
databaseType -
basePropsFilePath -
Method Detail

getSqlFile

public java.lang.String getSqlFile()
Get the current input sql file

Returns:
the sql file

setSqlFile

public void setSqlFile(java.lang.String sqlFile)
Set the current input sql file

Parameters:
sqlFile - the sql file

execute

public AppData execute()
                throws java.io.IOException,
                       ParseException
Execute the parser.

Throws:
java.io.IOException - If an I/O error occurs
ParseException - error parsing the input file

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Just 4 testing.

Parameters:
args - commandline args
Throws:
java.lang.Exception - an exception


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.