|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.db.SQLExecutor
public class SQLExecutor
Executes SQL statements
Field Summary | |
---|---|
static String |
ON_ERROR_ABORT
Call setOnError(String) with this value to abort SQL command execution if an error is found. |
static String |
ON_ERROR_ABORT_AFTER
Call setOnError(String) with this value to continue SQL command execution until all commands have been
attempted, then abort the build if an SQL error occurred in any of the commands. |
static String |
ON_ERROR_CONTINUE
Call setOnError(String) with this value to continue SQL command execution if an error is found. |
Constructor Summary | |
---|---|
SQLExecutor()
|
Method Summary | |
---|---|
void |
addListener(DatabaseListener listener)
|
void |
debug(String message)
|
void |
error(String message)
|
void |
error(Throwable throwable,
String message)
|
protected void |
execSQL(String sql,
PrintStream out)
Exec the sql statement. |
void |
execute()
|
void |
executeSql(String sql)
|
void |
executeTransaction(Transaction transaction)
|
protected void |
fireAfterExecuteSQL(int totalStatements,
String sql)
|
protected void |
fireAfterProcessingSQLResults(int totalStatements,
int successfulStatements,
int updateCountTotal,
String sql)
|
protected void |
fireBeforeExecuteSQL(int totalStatements,
String sql)
|
protected void |
fireBeginTransaction(Transaction transaction)
|
protected void |
fireFinishTransaction(Transaction transaction)
|
protected void |
fireMessageLogged(String message)
|
protected void |
fireMessageLogged(String message,
MessagePriority priority)
|
Connection |
getConn()
|
String |
getDelimiter()
|
String |
getDelimiterType()
|
protected DatabaseEvent |
getExecuteSQLEvent(int totalStatements,
String sql)
|
List<DatabaseListener> |
getListeners()
|
String |
getOnError()
|
String |
getOutputDelimiter()
|
Statement |
getStatement()
|
int |
getSuccessfulStatements()
|
int |
getTotalStatements()
|
Vector<Transaction> |
getTransactions()
|
void |
info(String message)
|
boolean |
isAppend()
|
boolean |
isAutocommit()
|
boolean |
isConnectionError()
|
boolean |
isEscapeProcessing()
|
boolean |
isKeepFormat()
|
boolean |
isPrintResultSet()
|
boolean |
isShowheaders()
|
boolean |
isSkipOnConnectionError()
|
protected void |
printResultSet(ResultSet rs,
PrintStream out)
print any results in the result set. |
protected void |
runStatements(Reader reader,
PrintStream out)
read in lines and execute them |
protected void |
runTransaction(Transaction t,
PrintStream out)
|
void |
setAppend(boolean append)
|
void |
setAutocommit(boolean autocommit)
|
void |
setConn(Connection conn)
|
void |
setConnectionError(boolean connectionError)
|
void |
setDelimiter(String delimiter)
|
void |
setDelimiterType(String delimiterType)
|
void |
setEscapeProcessing(boolean escapeProcessing)
|
void |
setKeepFormat(boolean keepFormat)
|
void |
setListeners(List<DatabaseListener> listeners)
|
void |
setOnError(String onError)
|
void |
setOutputDelimiter(String outputDelimiter)
|
void |
setPrintResultSet(boolean printResultSet)
|
void |
setShowheaders(boolean showheaders)
|
void |
setSkipOnConnectionError(boolean skipOnConnectionError)
|
void |
setStatement(Statement statement)
|
void |
setSuccessfulStatements(int successfulStatements)
|
void |
setTotalStatements(int totalStatements)
|
void |
setTransactions(Vector<Transaction> transactions)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ON_ERROR_ABORT
setOnError(String)
with this value to abort SQL command execution if an error is found.
public static final String ON_ERROR_ABORT_AFTER
setOnError(String)
with this value to continue SQL command execution until all commands have been
attempted, then abort the build if an SQL error occurred in any of the commands.
public static final String ON_ERROR_CONTINUE
setOnError(String)
with this value to continue SQL command execution if an error is found.
Constructor Detail |
---|
public SQLExecutor()
Method Detail |
---|
public void addListener(DatabaseListener listener)
protected void fireMessageLogged(String message)
protected void fireMessageLogged(String message, MessagePriority priority)
protected void fireBeginTransaction(Transaction transaction)
protected void fireFinishTransaction(Transaction transaction)
protected DatabaseEvent getExecuteSQLEvent(int totalStatements, String sql)
protected void fireBeforeExecuteSQL(int totalStatements, String sql)
protected void fireAfterExecuteSQL(int totalStatements, String sql)
protected void fireAfterProcessingSQLResults(int totalStatements, int successfulStatements, int updateCountTotal, String sql)
public void info(String message)
public void debug(String message)
public void error(Throwable throwable, String message)
public void error(String message)
public void executeSql(String sql) throws SQLException
SQLException
public void executeTransaction(Transaction transaction) throws SQLException
SQLException
public void execute() throws SQLException
SQLException
protected void runTransaction(Transaction t, PrintStream out) throws IOException, SQLException
IOException
SQLException
protected void execSQL(String sql, PrintStream out) throws SQLException
sql
- query to executeout
- the outputstream
SQLException
protected void runStatements(Reader reader, PrintStream out) throws SQLException, IOException
reader
- the readerout
- the outputstream
SQLException
IOException
protected void printResultSet(ResultSet rs, PrintStream out) throws SQLException
rs
- the resultset to print information aboutout
- the place to print results
SQLException
- on SQL problems.public boolean isKeepFormat()
public void setKeepFormat(boolean keepFormat)
public String getDelimiterType()
public void setDelimiterType(String delimiterType)
public String getDelimiter()
public void setDelimiter(String delimiter)
public boolean isPrintResultSet()
public void setPrintResultSet(boolean printResultSet)
public String getOnError()
public void setOnError(String onError)
public boolean isShowheaders()
public void setShowheaders(boolean showheaders)
public String getOutputDelimiter()
public void setOutputDelimiter(String outputDelimiter)
public int getTotalStatements()
public void setTotalStatements(int totalStatements)
public int getSuccessfulStatements()
public void setSuccessfulStatements(int successfulStatements)
public Connection getConn()
public void setConn(Connection conn)
public Statement getStatement()
public void setStatement(Statement statement)
public boolean isAutocommit()
public void setAutocommit(boolean autocommit)
public boolean isEscapeProcessing()
public void setEscapeProcessing(boolean escapeProcessing)
public boolean isAppend()
public void setAppend(boolean append)
public boolean isSkipOnConnectionError()
public void setSkipOnConnectionError(boolean skipOnConnectionError)
public boolean isConnectionError()
public void setConnectionError(boolean connectionError)
public List<DatabaseListener> getListeners()
public void setListeners(List<DatabaseListener> listeners)
public Vector<Transaction> getTransactions()
public void setTransactions(Vector<Transaction> transactions)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |