net.sourceforge.jdbcexporter.engine
Class BasicEngine

java.lang.Object
  extended bynet.sourceforge.jdbcexporter.engine.BasicEngine
All Implemented Interfaces:
ExportEngine

public class BasicEngine
extends java.lang.Object
implements ExportEngine

The BasicEngine class implements the ExportEngine interface to provide basic export capability. The BasicEngine exports rows from a database via a select statement. The following SQL Types are supported:

Version:
0.6
Author:
Chris Nagy

Field Summary
protected  ExportColumnDef[] columnDefs
          The current entity definition's columns that is being exported.
protected  java.sql.Connection connection
          The JDBC connection.
protected  ExportEntityDef entityDef
          The current entity definition that is being exported.
protected  JDBCParameterHelper exportEngineHelper
          The helper class for retrieving parameters from result sets.
protected  java.sql.ResultSet resultSet
          The result set.
protected  java.sql.Statement statement
          The statement.
 
Constructor Summary
BasicEngine()
           
 
Method Summary
 void cleanup()
          Cleans up any resources that the export engine used to export data for the current entity definition.
 ColumnValue[] exportRow()
          Export a row as a set of values from the database
 java.sql.Connection getConnection()
          Returns the database connection to use for exporting the row.
 void init()
          Initializes the export engine with the current entity definition.
 void setConnection(java.sql.Connection con)
          Sets the database connection to use for exporting the row.
 void setEntityDef(ExportEntityDef entityDef)
          Sets the entity definition to use for exporting the row
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exportEngineHelper

protected JDBCParameterHelper exportEngineHelper
The helper class for retrieving parameters from result sets.


connection

protected java.sql.Connection connection
The JDBC connection.


entityDef

protected ExportEntityDef entityDef
The current entity definition that is being exported.


columnDefs

protected ExportColumnDef[] columnDefs
The current entity definition's columns that is being exported.


statement

protected java.sql.Statement statement
The statement.


resultSet

protected java.sql.ResultSet resultSet
The result set.

Constructor Detail

BasicEngine

public BasicEngine()
Method Detail

setConnection

public void setConnection(java.sql.Connection con)
Description copied from interface: ExportEngine
Sets the database connection to use for exporting the row.

Specified by:
setConnection in interface ExportEngine
Parameters:
con - database connection
See Also:
ExportEngine.setConnection(java.sql.Connection)

getConnection

public java.sql.Connection getConnection()
Description copied from interface: ExportEngine
Returns the database connection to use for exporting the row.

Specified by:
getConnection in interface ExportEngine
Returns:
database connection
See Also:
ExportEngine.getConnection()

setEntityDef

public void setEntityDef(ExportEntityDef entityDef)
Description copied from interface: ExportEngine
Sets the entity definition to use for exporting the row

Specified by:
setEntityDef in interface ExportEngine
Parameters:
entityDef - entity definition
See Also:
ExportEngine.setEntityDef(net.sourceforge.jdbcexporter.ExportEntityDef)

init

public void init()
          throws java.sql.SQLException
Description copied from interface: ExportEngine
Initializes the export engine with the current entity definition.

Specified by:
init in interface ExportEngine
Throws:
java.sql.SQLException - if a database error occurs during initialization
See Also:
ExportEngine.init()

cleanup

public void cleanup()
             throws java.sql.SQLException
Description copied from interface: ExportEngine
Cleans up any resources that the export engine used to export data for the current entity definition.

Specified by:
cleanup in interface ExportEngine
Throws:
java.sql.SQLException - if a database error occurs during cleanup
See Also:
ExportEngine.cleanup()

exportRow

public ColumnValue[] exportRow()
                        throws java.sql.SQLException
Description copied from interface: ExportEngine
Export a row as a set of values from the database

Specified by:
exportRow in interface ExportEngine
Returns:
values the column values for the row
Throws:
java.sql.SQLException - if a database error occurs during the export
See Also:
ExportEngine.exportRow()