Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.admin.sql
Class SQLProcessor

    java.lang.Object
      oracle.ifs.admin.sql.SQLProcessor

    public class SQLProcessor

extends java.lang.Object

The `SQLProcessor` class preprocesses and executes SQL script files.

(Unpublished)
Modified:
  sgarg 02/24/2002 Enhanced the handling of "WHENEVER", sgarg 05/16/2001 Modifed scanKeyword to handle whitespaces., lsaenz 03/23/2001 Changed symbol substitution to handle dot tokens just after &VAR tokens; no longer using SymbolCommuter., lsaenz 07/18/2000 Fixed language-dependent concatenation., lsaenz 07/06/2000 Changed to use Log; made logging optional., lsaenz 02/14/2000 Removed calls which required native support in OsUtils; unused and unecessary., lsaenz 02/06/2000 Added import statements for subpackages of oracle.ifs.utils., lsaenz 12/03/1999 Hacked to ignore "WHENEVER" command., lsaenz 12/02/1999 Now uses OracleConnections rather than OracleConnectionFactory., lsaenz 11/07/1999 Removed all instantiate methods; now uses SymbolCommuter to do symbol substitution in expandLine()., lsaenz 09/23/1999 Made executeSQLFile() execute any remaining SQL in the SQL buffer after the end of file is reached in EVERY file pushed onto the InputStack, not just at the end of the last file., lsaenz 09/22/1999 Fixed bug in scanKeyword(), added one more PL/SQL type (TYPE BODY)., lsaenz 09/21/1999 Made symbol substitution optional (by using a parameter in executeSQLFile()) in processLine()., lsaenz 09/20/1999 Fixed various bugs, added feature to skip C-style comments within files., lsaenz 08/26/1999 Updated comments, modifed class to work with new oracle.ifs.installer classes., echui 04/19/1999 Appended '@' to DB URL for Oracle8i., echui 12/28/1998 Modified pop() to close BufferedReader., echui 12/01/1998 Fixed bug in getLine()., echui 11/03/1998 Used StringBuffers instead of Strings., echui 10/26/1998 Used JDBC instead of SQLJ., echui 10/16/1998 Created.

Field Summary
`static java.lang.String` | `ALPHANUM` String containing all alphanumeric characters, according to SQL.
`static java.lang.String` | `DELIMITER` String constant.
`static int` | `IFSTATE_ELSE` Mode for IFSTATE.
`static int` | `IFSTATE_IF` Mode for IFSTATE.
`static int` | `IFSTATE_NONE` Mode for IFSTATE.
`static int` | `LINE_LEN` SQLProcessor constant.
`static int` | `SQLSTMT_LEN` SQLProcessor constant.
`static int` | `SYMBOLS_NONE` Mode for SYMBOLS.
`static int` | `SYMBOLS_OFF` Mode for SYMBOLS.
`static int` | `SYMBOLS_ON` Mode for SYMBOLS.
`static java.lang.String` | `WHITESPACE` String constant.

Constructor Summary
`SQLProcessor()` Construct a new `SQLProcessor` class.
`SQLProcessor(java.sql.Connection con)` Construct a new `SQLProcessor` class given an existing Connection to a database.

Method Summary
`void` | `disconnect()` Closes the Connection to the database.
`java.lang.String` | `doExpandLine(java.lang.String line, java.util.Hashtable dict)` Removes symbol delimiter dots from lines with & symbols
`void` | `expandLine(java.lang.String line, java.lang.StringBuffer buffer, java.util.Hashtable dict, int substitution)` Expands a line by substituting symbols.
`void` | `finalize()` Finalizes this `SQLProcessor`.
`java.sql.Connection` | `getConnection()` Returns the Connection to the database.
`static void` | `main(java.lang.String[] args)`
`void` | `processLine(oracle.ifs.admin.sql.SQLProcessor.Context ctx, java.lang.String line, java.lang.StringBuffer sqlbuf)` Handles a line of SQL.
`void` | `runSQLFile(java.lang.String infile, java.lang.String outfile, java.util.Hashtable dict)` Executes a SQL file.
`void` | `runSQLFile(java.lang.String infile, java.lang.String outfile, java.util.Hashtable dict, boolean substitute, boolean echo, boolean noExecute, boolean stopOnErrors)`
`void` | `runSQLFile(java.lang.String infile, java.lang.String outfile, java.util.Hashtable dict, boolean substitute, boolean echo, boolean noExecute, boolean stopOnErrors, java.lang.String connectString)` Executes a SQL file.
`void` | `setConnection(java.sql.Connection con)` Sets the Connection to a database.

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### LINE_LEN

    public static final int LINE_LEN

  Description copied from class: `SQLProcessor`
  SQLProcessor constant.

  See Also:
    Constant Field Values
  (Unpublished)

### SQLSTMT_LEN

    public static final int SQLSTMT_LEN

  Description copied from class: `SQLProcessor`
  SQLProcessor constant.

  See Also:
    Constant Field Values
  (Unpublished)

### SYMBOLS_NONE

    public static final int SYMBOLS_NONE

  Description copied from class: `SQLProcessor`
  Mode for SYMBOLS.

  See Also:
    Constant Field Values
  (Unpublished)

### SYMBOLS_OFF

    public static final int SYMBOLS_OFF

  Description copied from class: `SQLProcessor`
  Mode for SYMBOLS.

  See Also:
    Constant Field Values
  (Unpublished)

### SYMBOLS_ON

    public static final int SYMBOLS_ON

  Description copied from class: `SQLProcessor`
  Mode for SYMBOLS.

  See Also:
    Constant Field Values
  (Unpublished)

### IFSTATE_NONE

    public static final int IFSTATE_NONE

  Description copied from class: `SQLProcessor`
  Mode for IFSTATE.

  See Also:
    Constant Field Values
  (Unpublished)

### IFSTATE_IF

    public static final int IFSTATE_IF

  Description copied from class: `SQLProcessor`
  Mode for IFSTATE.

  See Also:
    Constant Field Values
  (Unpublished)

### IFSTATE_ELSE

    public static final int IFSTATE_ELSE

  Description copied from class: `SQLProcessor`
  Mode for IFSTATE.

  See Also:
    Constant Field Values
  (Unpublished)

### WHITESPACE

    public static final java.lang.String WHITESPACE

  Description copied from class: `SQLProcessor`
  String constant.

  See Also:
    Constant Field Values
  (Unpublished)

### DELIMITER

    public static final java.lang.String DELIMITER

  Description copied from class: `SQLProcessor`
  String constant.

  See Also:
    Constant Field Values
  (Unpublished)

### ALPHANUM

    public static final java.lang.String ALPHANUM

  Description copied from class: `SQLProcessor`
  String containing all alphanumeric characters, according to SQL.

  See Also:
    Constant Field Values
  (Unpublished)

Constructor Detail

### SQLProcessor

    public SQLProcessor()

  Construct a new `SQLProcessor` class. No connection is made to a database.

  (Unpublished)

### SQLProcessor

    public SQLProcessor(java.sql.Connection con)
                 throws java.sql.SQLException

  Construct a new `SQLProcessor` class given an existing Connection to a database.

  Parameters:
    `con` - an existing JDBC Connection to a database.
  Throws:
    `java.sql.SQLException` - if an error occurs when trying to use the new Connection.
  (Unpublished)

Method Detail

### getConnection

    public java.sql.Connection getConnection()

  Description copied from class: `SQLProcessor`
  Returns the Connection to the database.

  Returns:
    the Connection to the database, or null if no Connection has been established.
  (Unpublished)

### disconnect

    public void disconnect()
                    throws java.sql.SQLException

  Description copied from class: `SQLProcessor`
  Closes the Connection to the database.

  Throws:
    `java.sql.SQLException` - if an error occurs when trying to close the Connection.
  (Unpublished)

### setConnection

    public void setConnection(java.sql.Connection con)
                       throws java.sql.SQLException

  Description copied from class: `SQLProcessor`
  Sets the Connection to a database.

  Parameters:
    `con` - a JDBC Connection to a database.
  Throws:
    `java.sql.SQLException` - if an error occurs when trying to create a Statement from the new Connection.
  (Unpublished)

### finalize

    public void finalize()

  Description copied from class: `SQLProcessor`
  Finalizes this `SQLProcessor`. Closes any remaining JDBC Connections or SQL Statements.

  Overrides:
    `finalize` in class `java.lang.Object`
  (Unpublished)

### runSQLFile

    public void runSQLFile(java.lang.String infile,
                           java.lang.String outfile,
                           java.util.Hashtable dict,
                           boolean substitute,
                           boolean echo,
                           boolean noExecute,
                           boolean stopOnErrors)
                    throws SQLProcessorException,
                           java.io.IOException

  Throws:
    `SQLProcessorException`
    `java.io.IOException`

### runSQLFile

    public void runSQLFile(java.lang.String infile,
                           java.lang.String outfile,
                           java.util.Hashtable dict,
                           boolean substitute,
                           boolean echo,
                           boolean noExecute,
                           boolean stopOnErrors,
                           java.lang.String connectString)
                    throws SQLProcessorException,
                           java.io.IOException

  Description copied from class: `SQLProcessor`
  Executes a SQL file.

  Throws:
    `SQLProcessorException`
    `java.io.IOException`
  (Unpublished)

### runSQLFile

    public void runSQLFile(java.lang.String infile,
                           java.lang.String outfile,
                           java.util.Hashtable dict)
                    throws SQLProcessorException,
                           java.io.IOException

  Description copied from class: `SQLProcessor`
  Executes a SQL file.

  Throws:
    `SQLProcessorException`
    `java.io.IOException`
  (Unpublished)

### expandLine

    public void expandLine(java.lang.String line,
                           java.lang.StringBuffer buffer,
                           java.util.Hashtable dict,
                           int substitution)
                    throws SQLProcessorException

  Description copied from class: `SQLProcessor`
  Expands a line by substituting symbols.

  Throws:
    `SQLProcessorException`
  (Unpublished)

### doExpandLine

    public java.lang.String doExpandLine(java.lang.String line,
                                         java.util.Hashtable dict)

  Description copied from class: `SQLProcessor`
  Removes symbol delimiter dots from lines with & symbols

### processLine

    public void processLine(oracle.ifs.admin.sql.SQLProcessor.Context ctx,
                            java.lang.String line,
                            java.lang.StringBuffer sqlbuf)
                     throws SQLProcessorException

  Description copied from class: `SQLProcessor`
  Handles a line of SQL.

  Throws:
    `SQLProcessorException`
  (Unpublished)

### main

    public static void main(java.lang.String[] args)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD