ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian M. Savage" <jsav...@fisci.com>
Subject [PATCH] Print SQL to System.out or output file
Date Fri, 22 Sep 2000 10:18:07 GMT
Here's a patch to to the SQLExec.java which adds the ability to pipe the results of SQL statements
executed with <sql/> to a file or the screen. It simply prints the output as comma delimited
values, optionally printing the headers. I wrote it thinking of using it to write queries
which generate sql statements which can then be fed back into <sql/> directive a second
time.

Here is sample usage:

                <sql
                        driver="${db.driver}"
                        url="${db.url}"
                        userid="${db.userid}"
                        password="${db.password}"
                        print="yes"
                        showheaders="no"
                        output="output.txt">
                select count(*) from footable
                </sql>

Julian.


Mime
View raw message