public class SqlConnectionTableInput extends AbstractTableInput implements ColumnMetadataHolder
DEFAULT_COLUMN_HEADER| Constructor and Description |
|---|
SqlConnectionTableInput(Connection conn,
String sqlStatement)
Builds the sql input based on the provided connection which will be
managed (closed) externally.
|
SqlConnectionTableInput(Connection conn,
String sqlStatement,
boolean closeConnectionWhenDone)
Builds the sql input based on the provided connection which will be
managed (closed) according to the managedConnection flag.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the input, releases the resources and signals that the reading
session is done.
|
List<ColumnMetadata> |
getColumnMetadata()
getter for columns metadata (column label/header, horizontal alignment, etc.)
|
boolean |
hasMoreRows()
returns true if there are more rows to read
|
List<Object> |
nextRow()
returns the next row
|
void |
open()
opens the Input in order to start reading from it
|
getStatuspublic SqlConnectionTableInput(Connection conn, String sqlStatement)
conn - the connection providedpublic SqlConnectionTableInput(Connection conn, String sqlStatement, boolean closeConnectionWhenDone)
conn - the connection providedsqlStatement - the sql statementmanagedConnection - if true the connection will be managed (close) by this classpublic void open()
open in interface TableInputopen in class AbstractTableInputpublic void close()
close in interface TableInputclose in class AbstractTableInputpublic List<Object> nextRow()
nextRow in interface TableInputpublic boolean hasMoreRows()
hasMoreRows in interface TableInputpublic List<ColumnMetadata> getColumnMetadata()
ColumnMetadataHoldergetter for columns metadata (column label/header, horizontal alignment, etc.)
This is an optional method. If your input doesn't contain any meta data then return an empty array.getColumnMetadata in interface ColumnMetadataHolderCopyright © 2006–2015. All rights reserved.