@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, setStatementParametersapplyTimeout, closeService, createStatement, getConnection, getConnection, getStatementTimeout, initService, prepare, prepareStatement, prepareStatement, setConnection, setStatementTimeout, start, stopchangeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontinueOnFailure, isBranching, setUniqueIdcreateName, createQualifier, isTrackingEndpointchangeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentStategetUniqueIdclose, init, start, stoppreparepublic JdbcDataQueryService()
public JdbcDataQueryService(JdbcStatementCreator creator)
protected void initJdbcService()
throws CoreException
initJdbcService in class JdbcServiceCoreExceptionprotected void prepareService()
throws CoreException
prepareService in class JdbcServiceCoreExceptionpublic void startService()
throws CoreException
JdbcServiceThis is called after the connection is started
startService in class JdbcServiceCoreExceptionprotected void closeJdbcService()
JdbcServiceThis is called before the connection is closed
closeJdbcService in class JdbcServicepublic void stopService()
JdbcServiceThis is called after before the connection is stopped
stopService in class JdbcServicepublic void doService(AdaptrisMessage msg) throws ServiceException
doService in interface Servicemsg - the AdaptrisMessage to processServiceException - wrapping any underlying ExceptionsService.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