public class SQLResultsSheet extends AbstractFilter<java.lang.Object,java.lang.Object> implements ArooaSessionAware, java.lang.Runnable, java.io.Closeable, java.io.Flushable
<oddjob> <job> <sql> <connection> <connection driver="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:mem:SQLResultsSheet_Example" username="sa" password=""/> </connection> <input> <buffer> create table FRUIT( TYPE varchar(16), VARIETY varchar(16), COLOUR varchar(32), SIZE double); insert into FRUIT values ('Apple', 'Cox', 'Red and Green', 7.6); insert into FRUIT values ('Orange', 'Jaffa', 'Orange', 9.245); select * from FRUIT; shutdown; </buffer> </input> <results> <sql-results-sheet/> </results> </sql> </job> </oddjob>
This writes the following to the console:
[0 rows affected, 16 ms.]
[1 rows affected, 0 ms.]
[1 rows affected, 0 ms.]
TYPE VARIETY COLOUR SIZE
------ ------- ------------- -----
Apple Cox Red and Green 7.6
Orange Jaffa Orange 9.245
[2 rows, 212 ms.]
[0 rows affected, 0 ms.]
Constructor and Description |
---|
SQLResultsSheet() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected java.lang.Object |
filter(java.lang.Object from) |
void |
flush() |
java.io.OutputStream |
getOutput() |
boolean |
isDataOnly() |
void |
run() |
void |
setArooaSession(ArooaSession session)
Accept the current Arooa Session.
|
void |
setDataOnly(boolean dataOnly) |
void |
setOutput(java.io.OutputStream output) |
void |
writeBeans(java.util.List<java.lang.Object> beans) |
accept, getName, getTo, setName, setTo, toString
public void setArooaSession(ArooaSession session)
ArooaSessionAware
setArooaSession
in interface ArooaSessionAware
session
- The Arooa Session. Never null.public void run()
run
in interface java.lang.Runnable
protected java.lang.Object filter(java.lang.Object from)
filter
in class AbstractFilter<java.lang.Object,java.lang.Object>
public void writeBeans(java.util.List<java.lang.Object> beans)
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public java.io.OutputStream getOutput()
public void setOutput(java.io.OutputStream output)
public boolean isDataOnly()
public void setDataOnly(boolean dataOnly)