|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.tools.ij.utilMain
public class utilMain
This class is utilities specific to the two ij Main's. This factoring enables sharing the functionality for single and dual connection ij runs.
Field Summary | |
---|---|
static int |
BUFFEREDFILESIZE
|
(package private) UCode_CharStream |
charStream
|
private StatementFinder[] |
commandGrabber
|
(package private) ConnectionEnv[] |
connEnv
|
private int |
currCE
|
private boolean |
fileInput
|
private boolean |
firstRun
|
private java.util.Hashtable |
ignoreErrors
|
private java.lang.String |
ijExceptionTrace
Value of the system property ij.execptionTrace |
(package private) ij |
ijParser
|
(package private) ijTokenManager |
ijTokMgr
|
private boolean |
initialFileInput
|
(package private) LocalizedResource |
langUtil
|
private boolean |
mtUse
|
private int |
numConnections
|
(package private) java.util.Stack |
oldGrabbers
|
private LocalizedOutput |
out
|
private boolean |
showErrorCode
True if to display the error code when displaying a SQLException. |
Constructor Summary | |
---|---|
utilMain(int numConnections,
LocalizedOutput out)
Set up the test to run with 'numConnections' connections/users. |
|
utilMain(int numConnections,
LocalizedOutput out,
boolean loadSystemProperties)
Set up the test to run with 'numConnections' connections/users. |
|
utilMain(int numConnections,
LocalizedOutput out,
java.util.Hashtable ignoreErrors)
Set up the test to run with 'numConnections' connections/users. |
Method Summary | |
---|---|
(package private) ijResult |
absolute(java.sql.ResultSet rs,
int row)
Position on the specified row of the specified ResultSet. |
(package private) ijResult |
afterLast(java.sql.ResultSet rs)
Position after the last row of the specified ResultSet and return NULL to the user. |
(package private) ijResult |
beforeFirst(java.sql.ResultSet rs)
Position before the first row of the specified ResultSet and return NULL to the user. |
private void |
checkScrollableCursor(java.sql.ResultSet rs,
java.lang.String operation)
Check that the cursor is scrollable. |
private void |
cleanupGo(LocalizedInput[] in)
Perform cleanup after a script has been run. |
private void |
displayResult(LocalizedOutput out,
ijResult result,
java.sql.Connection conn)
|
private boolean |
doCatch(java.lang.String command)
catch processing on failed commands. |
(package private) static void |
doPrompt(boolean newStatement,
LocalizedOutput out,
java.lang.String tag)
REMIND: eventually this might be part of StatementFinder, used at each carriage return to show that it is still "live" when it is reading multi-line input. |
private void |
doTrace(java.lang.Throwable t)
stack trace dumper |
(package private) ijResult |
first(java.sql.ResultSet rs)
Position on the first row of the specified ResultSet and return that row to the user. |
(package private) int |
getCurrentRowNumber(java.sql.ResultSet rs)
Get the current row number |
void |
go(LocalizedInput[] in,
LocalizedOutput out)
run ij over the specified input, sending output to the specified output. |
int |
goScript(java.sql.Connection conn,
LocalizedInput in)
Support to run a script. |
private void |
handleSQLException(LocalizedOutput out,
java.sql.SQLException e)
This routine displays SQL exceptions and decides whether they are fatal or not, based on the ignoreErrors field. |
void |
initFromEnvironment()
Initialize the connections from the environment. |
(package private) ijResult |
last(java.sql.ResultSet rs)
Position on the last row of the specified ResultSet and return that row to the user. |
(package private) void |
newInput(java.lang.String fileName)
|
(package private) void |
newResourceInput(java.lang.String resourceName)
|
(package private) ijResult |
previous(java.sql.ResultSet rs)
Position on the previous row of the specified ResultSet and return that row to the user. |
(package private) ijResult |
relative(java.sql.ResultSet rs,
int row)
Move the cursor position by the specified amount. |
java.lang.Object |
run()
|
private int |
runScriptGuts()
Run the guts of the script. |
(package private) void |
setMtUse(boolean b)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private StatementFinder[] commandGrabber
UCode_CharStream charStream
ijTokenManager ijTokMgr
ij ijParser
ConnectionEnv[] connEnv
private int currCE
private final int numConnections
private boolean fileInput
private boolean initialFileInput
private boolean mtUse
private boolean firstRun
private LocalizedOutput out
private java.util.Hashtable ignoreErrors
private final boolean showErrorCode
private final java.lang.String ijExceptionTrace
public static final int BUFFEREDFILESIZE
java.util.Stack oldGrabbers
LocalizedResource langUtil
Constructor Detail |
---|
utilMain(int numConnections, LocalizedOutput out) throws ijFatalException
numConnections
- The number of connections/users to test.
ijFatalException
utilMain(int numConnections, LocalizedOutput out, boolean loadSystemProperties) throws ijFatalException
numConnections
- The number of connections/users to test.
ijFatalException
public utilMain(int numConnections, LocalizedOutput out, java.util.Hashtable ignoreErrors) throws ijFatalException
numConnections
- The number of connections/users to test.ignoreErrors
- A list of errors to ignore. If null,
all errors are printed out and nothing
is fatal. If non-null, if an error is
hit and it is in this list, it is silently
ignore. Otherwise, an ijFatalException is
thrown. ignoreErrors is used for stress
tests.
ijFatalException
Method Detail |
---|
public void initFromEnvironment()
public void go(LocalizedInput[] in, LocalizedOutput out) throws ijFatalException
in
- source for input to ijout
- sink for output from ij
ijFatalException
public int goScript(java.sql.Connection conn, LocalizedInput in)
conn
- in
- private int runScriptGuts()
private void cleanupGo(LocalizedInput[] in)
in
- private void displayResult(LocalizedOutput out, ijResult result, java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
private boolean doCatch(java.lang.String command)
private void handleSQLException(LocalizedOutput out, java.sql.SQLException e) throws ijFatalException
ijFatalException
private void doTrace(java.lang.Throwable t)
void newInput(java.lang.String fileName)
void newResourceInput(java.lang.String resourceName)
static void doPrompt(boolean newStatement, LocalizedOutput out, java.lang.String tag)
void setMtUse(boolean b)
private void checkScrollableCursor(java.sql.ResultSet rs, java.lang.String operation) throws ijException, java.sql.SQLException
rs
- the ResultSet to checkoperation
- which operation this is checked for
ijException
- if the cursor isn't scrollable
java.sql.SQLException
- if a database error occursijResult absolute(java.sql.ResultSet rs, int row) throws java.sql.SQLException
rs
- The specified ResultSet.row
- The row # to move to.
(Negative means from the end of the result set.)
java.sql.SQLException
- thrown on error.
(absolute() not supported pre-JDBC2.0)ijResult relative(java.sql.ResultSet rs, int row) throws java.sql.SQLException
rs
- The specified ResultSet.row
- The # of rows to move.
(Negative means toward the beginning of the result set.)
java.sql.SQLException
- thrown on error.
(relative() not supported pre-JDBC2.0)ijResult beforeFirst(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- The specified ResultSet.
java.sql.SQLException
- thrown on error.
(beforeFirst() not supported pre-JDBC2.0)ijResult first(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- The specified ResultSet.
java.sql.SQLException
- thrown on error.
(first() not supported pre-JDBC2.0)ijResult afterLast(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- The specified ResultSet.
java.sql.SQLException
- thrown on error.
(afterLast() not supported pre-JDBC2.0)ijResult last(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- The specified ResultSet.
java.sql.SQLException
- thrown on error.
(last() not supported pre-JDBC2.0)ijResult previous(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- The specified ResultSet.
java.sql.SQLException
- thrown on error.
(previous() not supported pre-JDBC2.0)int getCurrentRowNumber(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- The specified ResultSet.
java.sql.SQLException
- thrown on error.
(getRow() not supported pre-JDBC2.0)public final java.lang.Object run()
run
in interface java.security.PrivilegedAction
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |