commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1638117 - /commons/proper/csv/trunk/src/site/xdoc/user-guide.xml
Date Tue, 11 Nov 2014 14:21:01 GMT
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>



Mime
View raw message