|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lapetus_ltd.api.db.control.TLptsRowSetOutputListener
public class TLptsRowSetOutputListener
Class Description :
There are 4 options for processing the rowset information:
The information can be output to xml, which can be written to file or retrieved from this class
as an object of type XLptsXmlRowSetType.
Nested Class Summary | |
---|---|
static class |
TLptsRowSetOutputListener.OUTPUT_TYPE
|
Constructor Summary | |
---|---|
TLptsRowSetOutputListener(java.lang.String fileName,
TLptsRowSetOutputListener.OUTPUT_TYPE outputType,
java.lang.String charset)
Construct this listener for writing rowset output to a data, debug or XML file. |
Method Summary | |
---|---|
void |
closeOutputFile()
Closes the output files for XML, debug and data output. |
TLptsXmlRowSetType |
getXmlRowSet()
Gets the RowSet XML data. |
boolean |
processNewRowSetRows(TLptsRowSetEvent rowSetEvent)
Implementation of ILptsFactoryRowSetListener . |
void |
rowEvent(TLptsRowEvent rowEvent)
Implementation of ILptsFactoryRowSetListener . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TLptsRowSetOutputListener(java.lang.String fileName, TLptsRowSetOutputListener.OUTPUT_TYPE outputType, java.lang.String charset)
String path = TLptsFileUtil.createDirectoryPath(TLptsFileUtil.getCurrentDirectory() + "test"); TLptsFactoryRowSet.addListener(rowSetOutputXmlListener = new TLptsRowSetOutputListener(path + "resultset.xml", TLptsRowSetOutputListener.OUTPUT_TYPE.OUTPUT_TO_XML));
fileName
- Supply a file name to write XML or text output. Null means output to stdout.outputType
- The types are follows:
TLptsRowSetOutputListener.OUTPUT_TYPE.OUTPUT_TO_XML,
TLptsRowSetOutputListener.OUTPUT_TYPE.DEBUG_OUTPUT,
TLptsRowSetOutputListener.OUTPUT_TYPE.DATA_OUTPUT,
The names are pretty self explanatory. If any of this options are provided with a null file name
then the output is sent to std out, with the exception of OUTPUT_TO_XML.
The XML output can be retrieved using the function getXmlRowSet()
, if OUTPUT_TO_XML is specified.charset
- This is the charset to be used for processing the file. It should be the same as the statement charset.Method Detail |
---|
public void closeOutputFile()
private class RowSetListener implements ILptsFactoryRowSetListener { public boolean processNewRowSetRows(TLptsRowSetEvent rowSetEvent) { return true; } public void rowEvent(final TLptsRowEvent rowEvent) { if (rowEvent.getEventType() == TLptsRowEvent.EVENT_TYPE.PROCESSING_COMPLETE || rowEvent.getEventType() == TLptsRowEvent.EVENT_TYPE.EXECUTION_INTERRUPTED || rowEvent.getEventType() == TLptsRowEvent.EVENT_TYPE.ERROR_OCCURRED) closeOutputFile(); } }
public TLptsXmlRowSetType getXmlRowSet()
public void addMultipleRows() { TLptsXmlRowSetType xmlRowSetType = new TLptsXmlRowSetType(); // we declare the lists for the data infusion ListcolumnNames = new LinkedList (); columnNames.add("COLUMN_NAME_1"); columnNames.add("COLUMN_NAME_2"); List
public boolean processNewRowSetRows(TLptsRowSetEvent rowSetEvent)
ILptsFactoryRowSetListener
.
processNewRowSetRows
in interface ILptsFactoryRowSetListener
rowSetEvent
- A new row or null if there is an error.
public void rowEvent(TLptsRowEvent rowEvent)
ILptsFactoryRowSetListener
.
rowEvent
in interface ILptsFactoryRowSetListener
rowEvent
- This is the new row. The event type indicates what kind of action it is.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |