org.knime.core.node.port.database
Class DatabaseReaderConnection

java.lang.Object
  extended by org.knime.core.node.port.database.DatabaseReaderConnection

public final class DatabaseReaderConnection
extends Object

Creates a connection to read from database.

Author:
Thomas Gabriel, University of Konstanz

Constructor Summary
DatabaseReaderConnection(DatabaseQueryConnectionSettings conn)
          Creates a empty handle for a new connection.
 
Method Summary
 BufferedDataTable createTable(ExecutionContext exec)
          Read data from database.
(package private)  DataTable createTable(int cachedNoRows)
           
 DataTableSpec getDataTableSpec()
          Returns a data table spec that reflects the meta data form the database result set.
 DatabaseQueryConnectionSettings getQueryConnection()
           
 void setDBQueryConnection(DatabaseQueryConnectionSettings conn)
          Sets anew connection object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseReaderConnection

public DatabaseReaderConnection(DatabaseQueryConnectionSettings conn)
Creates a empty handle for a new connection.

Parameters:
conn - a database connection object
Method Detail

setDBQueryConnection

public void setDBQueryConnection(DatabaseQueryConnectionSettings conn)
Sets anew connection object.

Parameters:
conn - the connection

getQueryConnection

public DatabaseQueryConnectionSettings getQueryConnection()
Returns:
connection settings object

getDataTableSpec

public DataTableSpec getDataTableSpec()
                               throws SQLException
Returns a data table spec that reflects the meta data form the database result set.

Returns:
data table spec
Throws:
SQLException - if the connection to the database could not be established

createTable

public BufferedDataTable createTable(ExecutionContext exec)
                              throws CanceledExecutionException,
                                     SQLException
Read data from database.

Parameters:
exec - used for progress info
Returns:
buffered data table read from database
Throws:
CanceledExecutionException - if canceled in between
SQLException - if the connection could not be opened

createTable

DataTable createTable(int cachedNoRows)
                throws SQLException
Parameters:
cachedNoRows - number of rows cached for data preview
Returns:
buffered data table read from database
Throws:
SQLException - if the connection could not be opened


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.