public abstract class AbstractDatabaseConnection extends Object implements IDatabaseConnection
Constructor and Description |
---|
AbstractDatabaseConnection() |
Modifier and Type | Method and Description |
---|---|
IDataSet |
createDataSet()
Creates a dataset corresponding to the entire database.
|
IDataSet |
createDataSet(String[] tableNames)
Creates a dataset containing only the specified tables from
the database.
|
ITable |
createQueryTable(String resultName,
String sql)
Creates a table with the result of the specified SQL statement.
|
ITable |
createTable(String tableName)
Creates a table with the result of a
select * from tableName SQL statement. |
ITable |
createTable(String resultName,
PreparedStatement preparedStatement)
Creates a table using the given PreparedStatement to retrieve a ResultSet.
|
DatabaseConfig |
getConfig()
Returns this connection database configuration
|
int |
getRowCount(String tableName)
Returns the specified table row count.
|
int |
getRowCount(String tableName,
String whereClause)
Returns the specified table row count according specified where clause.
|
IStatementFactory |
getStatementFactory()
Deprecated.
Use
getConfig() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, getConnection, getSchema
public IDataSet createDataSet() throws SQLException
IDatabaseConnection
createDataSet
in interface IDatabaseConnection
SQLException
public IDataSet createDataSet(String[] tableNames) throws DataSetException, SQLException
IDatabaseConnection
createDataSet
in interface IDatabaseConnection
tableNames
- The tables for which a dataset shall be createdDataSetException
SQLException
public ITable createQueryTable(String resultName, String sql) throws DataSetException, SQLException
IDatabaseConnection
createQueryTable
in interface IDatabaseConnection
resultName
- The name to be returned by ITableMetaData.getTableName()
.sql
- The SQL SELECT
statementDataSetException
SQLException
public ITable createTable(String resultName, PreparedStatement preparedStatement) throws DataSetException, SQLException
IDatabaseConnection
createTable
in interface IDatabaseConnection
resultName
- The name to be returned by ITableMetaData.getTableName()
.preparedStatement
- The statement to be executed as queryDataSetException
SQLException
public ITable createTable(String tableName) throws DataSetException, SQLException
IDatabaseConnection
select * from tableName
SQL statement.createTable
in interface IDatabaseConnection
tableName
- The name of the database table to be queried which is also returned by
ITableMetaData.getTableName()
.DataSetException
SQLException
public int getRowCount(String tableName) throws SQLException
IDatabaseConnection
getRowCount
in interface IDatabaseConnection
tableName
- the table nameSQLException
public int getRowCount(String tableName, String whereClause) throws SQLException
IDatabaseConnection
getRowCount
in interface IDatabaseConnection
tableName
- the table namewhereClause
- the where clauseSQLException
public DatabaseConfig getConfig()
IDatabaseConnection
getConfig
in interface IDatabaseConnection
public IStatementFactory getStatementFactory()
getConfig()
getStatementFactory
in interface IDatabaseConnection
Copyright © 2002–2016. All rights reserved.