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=""
userid="${db.userid}"
password="${db.password}"
print="yes"
showheaders="no"
output="output.txt">
select count(*) from
footable
</sql>
Very Good!! What about adding a classpath attribute
to locate multiple JDBC Drivers??
Byez
ANdreaT
|