Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joshua Cranmer Newsgroups: comp.lang.java.programmer Subject: Re: java.lang vs java.util Date: Mon, 04 Apr 2011 07:58:14 -0400 Organization: A noiseless patient Spider Lines: 20 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 4 Apr 2011 11:58:16 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="LtjcJP1H6uHOtkcPMh0bUA"; logging-data="28804"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18CIEhPUOgFmKkJSQr4RU/pDBgprQ2YdN4=" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16pre) Gecko/20110305 Lightning/1.0b3pre Thunderbird/3.1.10pre In-Reply-To: Cancel-Lock: sha1:O3H+3Jy1jx2OdG5YmPujxeIoCvg= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2845 On 04/04/2011 12:05 AM, Lawrence D'Oliveiro wrote: > Which reminds me, I’m still waiting for someone to show how they can do this > better > in Java. public void dumpToCSV(Writer out, Connection conn) throws IOException { Statement stmt = conn.createStatement(); ResultSet res = stmt.executeQuery(query); FormattedResulter.printCSV(res, out); } I'm sure somebody essentially wrote the class that does the last line for me, which, quite frankly, is correct enough given the information you've provided. If you cry foul, I'd like to point out that you gave only a very vague description of what goes on in the python code, plus you've clearly used other libraries in your own code. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth