You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2014/11/11 15:21:01 UTC
svn commit: r1638117 - /commons/proper/csv/trunk/src/site/xdoc/user-guide.xml
Author: ggregory
Date: Tue Nov 11 14:21:00 2014
New Revision: 1638117
URL: http://svn.apache.org/r1638117
Log:
[CSV-139] CSVPrinter.printRecord(ResultSet) with metadata.
Modified:
commons/proper/csv/trunk/src/site/xdoc/user-guide.xml
Modified: commons/proper/csv/trunk/src/site/xdoc/user-guide.xml
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/site/xdoc/user-guide.xml?rev=1638117&r1=1638116&r2=1638117&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/site/xdoc/user-guide.xml (original)
+++ commons/proper/csv/trunk/src/site/xdoc/user-guide.xml Tue Nov 11 14:21:00 2014
@@ -51,6 +51,18 @@ try {
reader.close();
}</source>
</section>
+<section name="Printing with headers">
+ <p>
+ To print a CSV file with headers, you specify the headers in the format:
+ </p>
+ <source>final Appendable out = ...;
+final CSVPrinter printer = CSVFormat.DEFAULT.withHeader("H1", "H2").print(out)</source>
+ <p>
+ To print a CSV file with JDBC column labels, you specify the ResultSet in the format:
+ </p>
+ <source>final ResultSet resultSet = ...;
+final CSVPrinter printer = CSVFormat.DEFAULT.withHeader(resultSet).print(out)</source>
+</section>
<!-- ================================================== -->
</body>
</document>