Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/net/efabrika/util/DBTablePrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,12 @@ public static void printResultSet(ResultSet rs, int maxStringColWidth) {
// Go through each row, get values of each column and adjust
// column widths.
int rowCount = 0;
while (rs.next()) {
if ( ! rs.isAfterLast() ) // No rows are printed if the RS advanced too far already
{
if ( rs.isBeforeFirst() ) // Ensure starting from the first record
{
rs.next();
}

// NOTE: columnIndex for rs.getXXX methods STARTS AT 1 NOT 0
for (int i = 0; i < columnCount; i++) {
Expand Down Expand Up @@ -508,7 +513,7 @@ public static void printResultSet(ResultSet rs, int maxStringColWidth) {
} // END of for loop columnCount
rowCount++;

} // END of while (rs.next)
} while ( rs.next() );

/*
At this point we have gone through meta data, get the
Expand Down