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
|
getStatus
public 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 TableInput
open
in class AbstractTableInput
public void close()
close
in interface TableInput
close
in class AbstractTableInput
public List<Object> nextRow()
nextRow
in interface TableInput
public boolean hasMoreRows()
hasMoreRows
in interface TableInput
public List<ColumnMetadata> getColumnMetadata()
ColumnMetadataHolder
getter 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 ColumnMetadataHolder
Copyright © 2006–2015. All rights reserved.