public class SQLProcessor extends Object
SQLProcessor
class preprocesses and executes
SQL script files.Modifier and Type | Field and Description |
---|---|
static String |
ALPHANUM
String containing all alphanumeric characters, according to SQL.
|
static 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 String |
WHITESPACE
String constant.
|
Constructor and Description |
---|
SQLProcessor()
Construct a new
SQLProcessor class. |
SQLProcessor(Connection con)
Construct a new
SQLProcessor class
given an existing Connection to a database. |
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Closes the Connection to the database.
|
String |
doExpandLine(String line,
Hashtable dict)
Removes symbol delimiter dots from lines with & symbols
|
void |
expandLine(String line,
StringBuffer buffer,
Hashtable dict,
int substitution)
Expands a line by substituting symbols.
|
void |
finalize()
Finalizes this
SQLProcessor . |
Connection |
getConnection()
Returns the Connection to the database.
|
static void |
main(String[] args) |
void |
processLine(oracle.ifs.admin.sql.SQLProcessor.Context ctx,
String line,
StringBuffer sqlbuf)
Handles a line of SQL.
|
void |
runSQLFile(String infile,
String outfile,
Hashtable dict)
Executes a SQL file.
|
void |
runSQLFile(String infile,
String outfile,
Hashtable dict,
boolean substitute,
boolean echo,
boolean noExecute,
boolean stopOnErrors) |
void |
runSQLFile(String infile,
String outfile,
Hashtable dict,
boolean substitute,
boolean echo,
boolean noExecute,
boolean stopOnErrors,
String connectString)
Executes a SQL file.
|
void |
setConnection(Connection con)
Sets the Connection to a database.
|
public static final int LINE_LEN
public static final int SQLSTMT_LEN
public static final int SYMBOLS_NONE
public static final int SYMBOLS_OFF
public static final int SYMBOLS_ON
public static final int IFSTATE_NONE
public static final int IFSTATE_IF
public static final int IFSTATE_ELSE
public static final String WHITESPACE
public static final String DELIMITER
public static final String ALPHANUM
public SQLProcessor()
SQLProcessor
class.
No connection is made to a database.public SQLProcessor(Connection con) throws SQLException
SQLProcessor
class
given an existing Connection to a database.con
- an existing JDBC Connection to a database.SQLException
- if an error occurs when trying
to use the new Connection.public Connection getConnection()
public void disconnect() throws SQLException
SQLException
- if an error occurs when trying
to close the Connection.public void setConnection(Connection con) throws SQLException
con
- a JDBC Connection to a database.SQLException
- if an error occurs when trying to
create a Statement from the new Connection.public void finalize()
SQLProcessor
.
Closes any remaining JDBC Connections or SQL Statements.public void runSQLFile(String infile, String outfile, Hashtable dict, boolean substitute, boolean echo, boolean noExecute, boolean stopOnErrors) throws SQLProcessorException, IOException
SQLProcessorException
IOException
public void runSQLFile(String infile, String outfile, Hashtable dict, boolean substitute, boolean echo, boolean noExecute, boolean stopOnErrors, String connectString) throws SQLProcessorException, IOException
SQLProcessorException
IOException
public void runSQLFile(String infile, String outfile, Hashtable dict) throws SQLProcessorException, IOException
SQLProcessorException
IOException
public void expandLine(String line, StringBuffer buffer, Hashtable dict, int substitution) throws SQLProcessorException
SQLProcessorException
public String doExpandLine(String line, Hashtable dict)
public void processLine(oracle.ifs.admin.sql.SQLProcessor.Context ctx, String line, StringBuffer sqlbuf) throws SQLProcessorException
SQLProcessorException
public static void main(String[] args)
Copyright © 2023. All rights reserved.