public class RunSQLScript extends Object
| Modifier and Type | Field and Description | 
|---|---|
protected String | 
sqlFile
The SQL file to execute. 
 | 
protected String | 
sqlLogFile
The log file to record SQL statements that have been executed. 
 | 
protected Hashtable | 
symbols
The symbols that need to be replaced in the SQL file. 
 | 
| Constructor and Description | 
|---|
RunSQLScript()
Creates a new RunSQLScript. 
 | 
RunSQLScript(String file)
Creates a new RunSQLScript. 
 | 
RunSQLScript(String file,
            String log)
Creates a new RunSQLScript class. 
 | 
RunSQLScript(String file,
            String log,
            Hashtable symbols)
Creates a new RunSQLScript given a Hashtable with
 symbol to value mappings for the symbols that need
 to be replaced in the SQL script. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
execute(Connection con)  | 
void | 
execute(Connection con,
       String connectString)
Runs a SQL script. 
 | 
void | 
setSQLFile(String file)  | 
void | 
setSQLLogFile(String log)  | 
void | 
setSymbols(Hashtable symbols)  | 
protected String sqlFile
protected String sqlLogFile
protected Hashtable symbols
public RunSQLScript()
public RunSQLScript(String file)
file - the SQL file to execute.public RunSQLScript(String file, String log)
file - the SQL file to execute.log - the log file to use.public RunSQLScript(String file, String log, Hashtable symbols)
file - the SQL file to execute.log - the log file to use.symbols - the symbols (mapped to values) to replace.public void setSQLFile(String file)
public void setSQLLogFile(String log)
public void setSymbols(Hashtable symbols)
public void execute(Connection con, String connectString) throws SQLException, SQLProcessorException, IOException
con - the JDBC Connection to use.SQLException - if a SQL command fails.SQLProcessorException - if processing the script fails.IOException - if an IO error occurs.public void execute(Connection con) throws SQLException, SQLProcessorException, IOException
Copyright © 2025. All rights reserved.