Package com.adaptris.core.services.jdbc
Class SimplePayloadResultSetTranslator
- java.lang.Object
-
- com.adaptris.core.services.jdbc.ResultSetTranslatorBase
-
- com.adaptris.core.services.jdbc.SimplePayloadResultSetTranslator
-
- All Implemented Interfaces:
ComponentLifecycle
,ComponentLifecycleExtension
,ResultSetTranslator
public class SimplePayloadResultSetTranslator extends ResultSetTranslatorBase
Takes the first result set, and the specified column (optional) and makes that the payload.Used as part of a
JdbcDataQueryService
In the adapter configuration file this class is aliased as jdbc-simple-output which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.services.jdbc.ResultSetTranslatorBase
log
-
-
Constructor Summary
Constructors Constructor Description SimplePayloadResultSetTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnWriter
columnWriter()
java.lang.String
getColumnName()
ColumnWriter
getColumnWriter()
void
setColumnName(java.lang.String columnName)
Set the column to be used as the payload.void
setColumnWriter(ColumnWriter cw)
void
translate(JdbcResult source, AdaptrisMessage target)
Translate the contents of the result set into the AdaptrisMessage object.-
Methods inherited from class com.adaptris.core.services.jdbc.ResultSetTranslatorBase
prepare
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
-
-
-
-
Method Detail
-
translate
public void translate(JdbcResult source, AdaptrisMessage target) throws java.sql.SQLException, ServiceException
Description copied from interface:ResultSetTranslator
Translate the contents of the result set into the AdaptrisMessage object. Only use this method for JdbcResults that are guaranteed to fit in memory.- Parameters:
source
- the result set from a database query executed byJdbcDataQueryService
target
- the adaptris message- Throws:
java.sql.SQLException
- on errors accessing the result set.ServiceException
- wrapping any other exception
-
getColumnName
public java.lang.String getColumnName()
-
setColumnName
public void setColumnName(java.lang.String columnName)
Set the column to be used as the payload.- Parameters:
columnName
- the column name, if not specified then the first column is used).
-
getColumnWriter
public ColumnWriter getColumnWriter()
-
setColumnWriter
public void setColumnWriter(ColumnWriter cw)
-
columnWriter
public ColumnWriter columnWriter()
-
-