public class ScriptRunner
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.regex.Pattern |
JDBC |
private static java.util.logging.Logger |
LOG
Logger
|
Constructor and Description |
---|
ScriptRunner() |
Modifier and Type | Method and Description |
---|---|
private static void |
execute(java.sql.Connection conn,
java.lang.String sql)
Execute an SQL statement.
|
static void |
main(java.lang.String... args)
Runner main method
|
private static java.lang.String |
readLine(java.io.Reader r)
Read the next line from the source Reader
|
private static void |
runScript(java.sql.Connection conn,
java.io.Reader script,
ScriptSplitter splitter)
Run SQL script against the database.
|
private static final java.util.logging.Logger LOG
private static final java.util.regex.Pattern JDBC
public static void main(java.lang.String... args) throws java.lang.Exception
args
- commant line arguments : [java.lang.Exception
- on Errorprivate static void runScript(java.sql.Connection conn, java.io.Reader script, ScriptSplitter splitter) throws java.io.IOException, java.sql.SQLException
conn
- database connection.script
- Reader for the script.java.io.IOException
- in I/O error.java.sql.SQLException
- in database error.private static void execute(java.sql.Connection conn, java.lang.String sql) throws java.sql.SQLException
conn
- database connection.sql
- SQL statement.java.sql.SQLException
- on error.private static java.lang.String readLine(java.io.Reader r) throws java.io.IOException
r
- Reader for the source filenull
if EOF.java.io.IOException
- in I/O error