Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

Commit 6757944

Browse files
committed
[CSV-139] CSVPrinter.printRecord(ResultSet) with metadata.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1638117 13f79535-47bb-0310-9956-ffa450edef68
1 parent 957295a commit 6757944

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/site/xdoc/user-guide.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ try {
5151
reader.close();
5252
}</source>
5353
</section>
54+
<section name="Printing with headers">
55+
<p>
56+
To print a CSV file with headers, you specify the headers in the format:
57+
</p>
58+
<source>final Appendable out = ...;
59+
final CSVPrinter printer = CSVFormat.DEFAULT.withHeader("H1", "H2").print(out)</source>
60+
<p>
61+
To print a CSV file with JDBC column labels, you specify the ResultSet in the format:
62+
</p>
63+
<source>final ResultSet resultSet = ...;
64+
final CSVPrinter printer = CSVFormat.DEFAULT.withHeader(resultSet).print(out)</source>
65+
</section>
5466
<!-- ================================================== -->
5567
</body>
5668
</document>

0 commit comments

Comments
 (0)