@ComponentProfile(summary="Query a database and store the results in the message", tag="service,jdbc", recommended=DatabaseConnection.class) public class JdbcDataQueryService extends JdbcServiceWithParameters implements DynamicPollingTemplate.TemplateProvider
In the adapter configuration file this class is aliased as jdbc-data-query-service which is the preferred alternative to the fully qualified classname when building your configuration.
log
Constructor and Description |
---|
JdbcDataQueryService() |
JdbcDataQueryService(JdbcStatementCreator creator) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeJdbcService()
Close the service.
|
void |
doService(AdaptrisMessage msg)
The main service method, which sees the specified query executed and the results returned in an XML message.
|
java.lang.Boolean |
getIgnoreExecuteQueryErrors() |
KeyValuePairSet |
getNamespaceContext() |
ResultSetTranslator |
getResultSetTranslator() |
JdbcStatementCreator |
getStatementCreator() |
DocumentBuilderFactoryBuilder |
getXmlDocumentFactoryConfig() |
protected void |
initJdbcService() |
protected void |
prepareService() |
void |
setIgnoreExecuteQueryErrors(java.lang.Boolean b)
Whether or not to ignore the SQL Exception when executing
PreparedStatement.executeQuery() . |
void |
setNamespaceContext(KeyValuePairSet kvps)
Set the namespace context for resolving namespaces.
|
void |
setResultSetTranslator(ResultSetTranslator outputTranslator)
Set the implementation that will be used to parse the result set.
|
void |
setStatementCreator(JdbcStatementCreator statementCreator)
Set the SQL Query statement creator.
|
void |
setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xml) |
void |
startService()
Start the service.
|
void |
stopService()
Stop the service.
|
addStatementParameter, getParameterApplicator, getStatementParameters, setParameterApplicator, setStatementParameters
applyTimeout, closeService, createStatement, getConnection, getConnection, getStatementTimeout, initService, prepare, prepareStatement, prepareStatement, setConnection, setStatementTimeout, start, stop
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
continueOnFailure, isBranching, setUniqueId
createName, createQualifier, isTrackingEndpoint
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
getUniqueId
close, init, start, stop
prepare
public JdbcDataQueryService()
public JdbcDataQueryService(JdbcStatementCreator creator)
protected void initJdbcService() throws CoreException
initJdbcService
in class JdbcService
CoreException
protected void prepareService() throws CoreException
prepareService
in class JdbcService
CoreException
public void startService() throws CoreException
JdbcService
This is called after the connection is started
startService
in class JdbcService
CoreException
protected void closeJdbcService()
JdbcService
This is called before the connection is closed
closeJdbcService
in class JdbcService
public void stopService()
JdbcService
This is called after before the connection is stopped
stopService
in class JdbcService
public void doService(AdaptrisMessage msg) throws ServiceException
doService
in interface Service
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
sService.doService(com.adaptris.core.AdaptrisMessage)
public ResultSetTranslator getResultSetTranslator()
public void setResultSetTranslator(ResultSetTranslator outputTranslator)
outputTranslator
- the implementation to use.public KeyValuePairSet getNamespaceContext()
public void setNamespaceContext(KeyValuePairSet kvps)
kvps
- the namespace contextSimpleNamespaceContext.create(KeyValuePairSet)
public DocumentBuilderFactoryBuilder getXmlDocumentFactoryConfig()
public void setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xml)
public JdbcStatementCreator getStatementCreator()
public void setStatementCreator(JdbcStatementCreator statementCreator)
statementCreator
- The statement creator to set.public java.lang.Boolean getIgnoreExecuteQueryErrors()
public void setIgnoreExecuteQueryErrors(java.lang.Boolean b)
PreparedStatement.executeQuery()
.
If set to true this means is that the PreparedStatement.executeQuery()
is treated as successful, but with
an empty result set.
b
- the ignoreExecuteQueryErrors to set