| Modifier and Type | Field and Description |
|---|---|
protected int |
debugLevel
Determines amount of intermediate diagnostic messages to
be printed.
|
| Constructor and Description |
|---|
sqlHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
printResultSet(ResultSet rs)
Print ResultSet generated by SQL query.
|
void |
printResultSet(ResultSet rs,
OutputStream output)
Print ResultSet generated by SQL query.
|
void |
printResultSet(ResultSet rs,
PrintStream output)
Print ResultSet generated by SQL query.
|
void |
setDebugLevel(int level)
Set amount of diagnostic messages to be printed.
|
protected int debugLevel
See the description for the setDebugLevel method for more information.
public sqlHelper()
public void setDebugLevel(int level)
level - Desired level of diagnostic messages.public void printResultSet(ResultSet rs)
This version has the destination for the listing set to System.out
rs - ResultSet to be printedSystempublic void printResultSet(ResultSet rs, OutputStream output)
This version uses a java.io.OutputStream so that the results can be sent to a file or some other container.
A java.io.OutputSteam object can be
created using the Java statement
java.io.FileOutputStream outputFile =
new java.io.FileOutputStream(outputFileName);
where outputFileName
is a String object containing the
name of the output file to be created.
rs - ResultSet object to be displayedoutput - Destination for listingFileOutputStreampublic void printResultSet(ResultSet rs, PrintStream output)
The object System.out is a java.io.PrintStream object. This version of the method is therefore suitable for printing to System.out.
rs - ResultSet to be printedoutput - Destination for listingSystemCopyright © 2017. All rights reserved.