Example usage for org.apache.commons.dbutils.handlers AbstractListHandler handle

List of usage examples for org.apache.commons.dbutils.handlers AbstractListHandler handle

Introduction

In this page you can find the example usage for org.apache.commons.dbutils.handlers AbstractListHandler handle.

Prototype

@Override
public List<T> handle(ResultSet rs) throws SQLException 

Source Link

Document

Whole ResultSet handler.

Usage

From source file:de.tu_berlin.dima.oligos.db.JdbcConnector.java

/**
 * Retrieves all schemas from the current database connection.
 * @return all schemas for the current connection
 * @throws SQLException if there occurs an error while retrieving the database 
 *//*from ww w . j a va 2s. co m*/
public Collection<SchemaRef> getSchemas() throws SQLException {
    AbstractListHandler<SchemaRef> handler = new SchemaRefsHandler();
    return handler.handle(metaData.getSchemas());
}

From source file:de.tu_berlin.dima.oligos.db.JdbcConnector.java

/**
 * Retrieves all tables of the schema from the current connection.
 * @param schema /*from w  ww  .ja  v a 2s.  com*/
 *  The schema reference of the tables
 * @return 
 *  all tables of the schema
 * @throws SQLException if a database access error occurs
 * @since 0.3.1
 */
public Collection<TableRef> getTables(final SchemaRef schema) throws SQLException {
    String catalog = null;
    String schemaPattern = schema.getSchemaName();
    String tablePattern = null;
    String[] types = null;
    AbstractListHandler<TableRef> handler = new TableRefsHandler();
    ResultSet rs = metaData.getTables(catalog, schemaPattern, tablePattern, types);
    return handler.handle(rs);
}

From source file:de.tu_berlin.dima.oligos.db.JdbcConnector.java

/**
 * Retrieves all columns of the table from the current database connection.
 * @param table The table reference to search the columns for
 * @return all columns of the table/*from   w  w  w .  j a va  2 s .  co m*/
 * @throws SQLException if a database access error occurs
 */
public Collection<ColumnRef> getColumns(final TableRef table) throws SQLException {
    String catalog = null;
    String schemaPattern = null;
    String columnNamePattern = null;
    AbstractListHandler<ColumnRef> handler = new ColumnRefsHandler();
    ResultSet rs = metaData.getColumns(catalog, schemaPattern, table.getTableName(), columnNamePattern);
    return handler.handle(rs);
}