public class SqlTableInput extends AbstractTableInput implements ColumnMetadataHolder
Report Input implementation for database queries
There are two ways of setting up this data provider :
Use case 1: providing database url, driver class , user and password
Use case 2: providing a connection
DEFAULT_COLUMN_HEADER
Constructor and Description |
---|
SqlTableInput(String dbConnString,
String driverClass,
String dbUser,
String dbPassword,
String sqlStatement)
this is the preferred way to construct this provider
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the input meaning : "the reading session it's done !"
|
List<ColumnMetadata> |
getColumnMetadata()
getter for columns metadata (column label/header, horizontal alignment, etc.)
|
String |
getDbConnString() |
String |
getDbDriverClass() |
String |
getDbPassword() |
String |
getDbUser() |
String |
getSqlStatement() |
boolean |
hasAllResourcesClosed()
debug method which returns true if all sql resources have been released
|
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 SqlTableInput(String dbConnString, String driverClass, String dbUser, String dbPassword, String sqlStatement)
dbConnString
- the database connection stringdriverClass
- the driver fully qualified class namedbUser
- the database userdbPassword
- database passwordpublic 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 String getDbConnString()
public String getDbDriverClass()
public String getDbPassword()
public String getDbUser()
public String getSqlStatement()
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
public boolean hasAllResourcesClosed() throws SQLException
SQLException
Copyright © 2006–2015. All rights reserved.