Skip to content

Commit

Permalink
modify example
Browse files Browse the repository at this point in the history
  • Loading branch information
shuwenwei committed Nov 22, 2024
1 parent 62e4a41 commit a56474b
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,12 @@ public static void main(String[] args) throws IOException {
// first column is Time
ResultSetMetadata metadata = resultSet.getMetadata();
System.out.println(metadata);
StringJoiner sj = new StringJoiner(" ");
for (int column = 1; column <= 5; column++) {
sj.add(metadata.getColumnName(column) + "(" + metadata.getColumnType(column) + ") ");
}
System.out.println(sj.toString());
while (resultSet.next()) {
StringJoiner sj = new StringJoiner(" ");
for (int column = 1; column <= 5; column++) {
sj.add(metadata.getColumnName(column) + "(" + metadata.getColumnType(column) + ") ");
}
System.out.println(sj.toString());

// columnIndex starts from 1
// Time id1 id2 s1 s2
Long timeField = resultSet.getLong("Time");
Expand Down

0 comments on commit a56474b

Please sign in to comment.