[ rubbish-db ]

ソース

RubbishDatabase dbh = new RubbishDatabase();
dbh.connect("jdbc:hsqldb:hsql://localhost", "sa", "");
Map[] rows = dbh.query("SELECT * FROM PUBLISHER");
dbh.disconnect();

CSV csv = new CSV(rows);
StringWriter writer = new StringWriter();
csv.export(writer);
writer.close();
println(writer);

結果

ID,NAME,VOLUMES,UPDATE_DATE,CREATE_DATE
00,ミュンヒハウゼン出版,1,2005-07-10 17:10:00.000,1999-07-10 17:10:00.000
01,栄学館,4,2005-07-10 17:10:00.000,1999-07-10 17:10:00.000
02,時源出版,4,2005-07-10 17:10:00.000,1999-07-10 17:10:00.000
03,曙蓬莱新聞社,4,2005-07-10 17:10:00.000,1999-07-10 17:10:00.000
04,太公望書林,12,2005-07-10 17:10:00.000,1999-07-10 17:10:00.000
05,日本曙蓬莱武術協会,5,2005-07-10 17:10:00.000,1999-07-10 17:10:00.000
06,民明書房,76,2005-07-10 17:10:00.000,1999-07-10 17:10:00.000