com.rhi.architecture.parc.adapter.jdbc
Class JDBCInputAdapter

java.lang.Object
  extended bycom.rhi.architecture.parc.adapter.AbstractInputAdapter
      extended bycom.rhi.architecture.parc.adapter.jdbc.JDBCInputAdapter
All Implemented Interfaces:
Adapter, InputAdapter

public abstract class JDBCInputAdapter
extends AbstractInputAdapter

Generic JDBC InputAdapter.

Since:
1.0
Author:
Pete McKinstry

Constructor Summary
JDBCInputAdapter()
          Default Constructor
 
Method Summary
protected  void bindValues(java.sql.PreparedStatement stmt)
          If necessary, bind the appropriate values to the PreparedStatement.
protected  long getBatchSize()
          Get method for batch size - allows override by sub-classes
protected  java.lang.String getQuery()
          Get method for SQL - allows override by sub-classes
 void init(java.util.Properties props)
          Perform any resource initialization.
protected  java.util.Collection loadBatch()
          Retrieve all the source records that should be processed by the pipeline.
protected  java.sql.PreparedStatement prepareStatement(java.sql.Connection conn)
          Allow override of Statement preparation in cases where the Input Adapters should load batches of records.
protected abstract  Record readRow(java.sql.ResultSet rs)
          Extract the attributes from the ResultSet and return a Record object.
 
Methods inherited from class com.rhi.architecture.parc.adapter.AbstractInputAdapter
addToErrorChannel, cleanup, getAuditAgent, getErrors, push, setAuditAgent, setErrorChannel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCInputAdapter

public JDBCInputAdapter()
Default Constructor

Since:
1.0
Method Detail

init

public void init(java.util.Properties props)
          throws InitializationException
Perform any resource initialization.

Specified by:
init in interface Adapter
Overrides:
init in class AbstractInputAdapter
Parameters:
props -
Throws:
InitializationException
Since:
1.0

loadBatch

protected java.util.Collection loadBatch()
                                  throws ProcessingException
Retrieve all the source records that should be processed by the pipeline.

Specified by:
loadBatch in class AbstractInputAdapter
Returns:
Collection - contains all the records ready for processing.
Throws:
ProcessingException
Since:
1.0

prepareStatement

protected java.sql.PreparedStatement prepareStatement(java.sql.Connection conn)
                                               throws java.sql.SQLException
Allow override of Statement preparation in cases where the Input Adapters should load batches of records.

Parameters:
conn -
Returns:
PreparedStatement
Throws:
java.sql.SQLException
Since:
1.1

getQuery

protected java.lang.String getQuery()
Get method for SQL - allows override by sub-classes

Returns:
String SQL
Since:
1.0

getBatchSize

protected long getBatchSize()
Get method for batch size - allows override by sub-classes

Returns:
long batch size
Since:
1.0

bindValues

protected void bindValues(java.sql.PreparedStatement stmt)
                   throws java.sql.SQLException
If necessary, bind the appropriate values to the PreparedStatement. The default implemenation is empty.

Parameters:
stmt - - the prepared statement to be executed.
Throws:
java.sql.SQLException
Since:
1.1

readRow

protected abstract Record readRow(java.sql.ResultSet rs)
                           throws java.sql.SQLException
Extract the attributes from the ResultSet and return a Record object. When overriding this method, create the appropriate Record type for your interface & return it through the generic Record interface.

Parameters:
rs -
Returns:
Record
Throws:
java.sql.SQLException
Since:
1.0


Copyright © 2002-2004 Robert Half International. All Rights Reserved.