Java Reference
In-Depth Information
// package com.darwinsys.sql;
public
public class
class
SQLRunner
SQLRunner
{
OutputMode outputMode
=
OutputMode
.
t
;
private
private static
static
boolean
boolean
okToExit
=
false
false
;
public
public static
static
void
void
setOkToExit
(
final
final
boolean
boolean
setting
) {
okToExit
=
setting
;
}
public
public static
static
boolean
boolean
isOkToExit
() {
return
return
okToExit
;
}
public
public static
static
void
void
exit
(
final
final
int
int
exitStatus
) {
iif
(
okToExit
) {
System
.
exit
(
exitStatus
);
}
else
else
{
// do nothing
}
}
/** Database connection */
private
private
Connection conn
;
private
private
DatabaseMetaData dbMeta
;
/** SQL Statement */
private
private
Statement statement
;
/** Where the output is going */
private
private
PrintWriter out
;
private
private
ResultsDecorator currentDecorator
;
/** Must be set at beginning */
private
private
ResultsDecorator textDecorator
=
new
new
ResultsDecoratorText
(
out
,
verbosity
);
private
private
ResultsDecorator sqlDecorator
;
private
private
ResultsDecorator htmlDecorator
;
private
private
ResultsDecorator xmlDecorator
;