Package nl.nn.adapterframework.jdbc
Class FixedQuerySender
- java.lang.Object
-
- nl.nn.adapterframework.jndi.JndiBase
-
- nl.nn.adapterframework.jdbc.JdbcFacade
-
- nl.nn.adapterframework.jdbc.JdbcSenderBase<H>
-
- nl.nn.adapterframework.jdbc.JdbcQuerySenderBase<QueryExecutionContext>
-
- nl.nn.adapterframework.jdbc.FixedQuerySender
-
- All Implemented Interfaces:
HasPhysicalDestination
,IBlockEnabledSender<QueryExecutionContext>
,IConfigurable
,IConfigurationAware
,INamedObject
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,IXAEnabled
,HasStatistics
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
ResultSet2FileSender
,StoredProcedureQuerySender
public class FixedQuerySender extends JdbcQuerySenderBase<QueryExecutionContext>
QuerySender that assumes a fixed query, possibly with attributes.NOTE: See
DB2XMLWriter
for ResultSet!- Since:
- 4.1
- Author:
- Gerrit van Brakel
- Parameters
- All parameters present are applied to the query to be executed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class nl.nn.adapterframework.jdbc.JdbcQuerySenderBase
JdbcQuerySenderBase.QueryType
-
Nested classes/interfaces inherited from interface nl.nn.adapterframework.statistics.HasStatistics
HasStatistics.Action
-
-
Field Summary
-
Fields inherited from class nl.nn.adapterframework.jdbc.JdbcQuerySenderBase
UNP_END, UNP_START
-
Fields inherited from class nl.nn.adapterframework.jdbc.JdbcSenderBase
connection, paramList
-
-
Constructor Summary
Constructors Constructor Description FixedQuerySender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeBlock(QueryExecutionContext blockHandle, PipeLineSession session)
close the resource that is opened byIBlockEnabledSender.openBlock(PipeLineSession)
.protected void
closeStatementSet(QueryExecutionContext statementSet)
void
configure()
configure()
is called once at startup of the framework in the configure method of the owner of this sender.int
getBatchSize()
String
getQuery()
protected String
getQuery(Message message)
Obtain a query to be executed.QueryExecutionContext
openBlock(PipeLineSession session)
open a resource that can be used multiple times whenIBlockEnabledSender.sendMessage(Object, Message, PipeLineSession)
is called.SenderResult
sendMessage(QueryExecutionContext blockHandle, Message message, PipeLineSession session)
void
setBatchSize(int batchSize)
When set larger than 0 and used as a child of an IteratingPipe, then the database calls are made in batches of this size.void
setQuery(String query)
The SQL query text to be excecuted each time sendMessage() is called-
Methods inherited from class nl.nn.adapterframework.jdbc.JdbcQuerySenderBase
adjustQueryAndParameterListForNamedParameters, closeConnectionForSendMessage, convertQuery, executeOtherQuery, executeOtherQuery, executePackageQuery, executeSelectQuery, executeSelectQuery, executeStatementSet, executeUpdateBlobQuery, executeUpdateClobQuery, fillParamArray, getBlobBase64Direction, getBlobCharset, getBlobColumn, getBlobSessionKey, getCallWithRowIdReturned, getClobColumn, getClobSessionKey, getColumnsReturned, getColumnsReturnedList, getConnectionForSendMessage, getLockWait, getMaxRows, getNullValue, getOutputFormat, getPackageContent, getQueryExecutionContext, getQueryTypeEnum, getResult, getResult, getResult, getResultQuery, getReturnedColumns, getRowIdSessionKey, getSqlDialect, getStartRow, getStatement, getStreamCharset, getUseNamedParams, isAvoidLocking, isBlobsCompressed, isBlobSmartGet, isCloseInputstreamOnExit, isCloseOutputstreamOnExit, isIncludeFieldDefinition, isLockRows, isPrettyPrint, isScalar, isScalarExtended, isStreamResultToServlet, isSynchronous, isTrimSpaces, open, prepareQuery, prepareQueryWithColumnsReturned, prepareQueryWithResultSet, setAvoidLocking, setBlobBase64Direction, setBlobCharset, setBlobColumn, setBlobsCompressed, setBlobSessionKey, setBlobSmartGet, setClobColumn, setClobSessionKey, setCloseInputstreamOnExit, setCloseOutputstreamOnExit, setColumnsReturned, setIncludeFieldDefinition, setLockRows, setLockWait, setMaxRows, setNullValue, setOutputFormat, setPackageContent, setPrettyPrint, setQueryType, setResultQuery, setRowIdSessionKey, setScalar, setScalarExtended, setSqlDialect, setStartRow, setStreamCharset, setStreamResultToServlet, setSynchronous, setTrimSpaces, setUseNamedParams
-
Methods inherited from class nl.nn.adapterframework.jdbc.JdbcSenderBase
addParameter, close, getParameterList, getTimeout, sendMessage, setTimeout, toString
-
Methods inherited from class nl.nn.adapterframework.jdbc.JdbcFacade
getAuthAlias, getConnection, getConnectionWithTimeout, getDatasource, getDataSourceFactory, getDatasourceInfo, getDatasourceName, getDbmsSupport, getDomain, getLogPrefix, getPassword, getPhysicalDestinationName, getUsername, isConnectionsArePooled, isTransacted, iterateOverStatistics, setAuthAlias, setConnectionsArePooled, setDataSourceFactory, setDatasourceName, setDbmsSupportFactory, setJmsRealm, setPassword, setTransacted, setUsername
-
Methods inherited from class nl.nn.adapterframework.jndi.JndiBase
getApplicationContext, getAuthentication, getConfigurationClassLoader, getContext, getCredentials, getInitialContextFactoryName, getJmsRealmName, getJndiAuthAlias, getJndiContextPrefix, getJndiEnv, getJndiProperties, getName, getPrincipal, getProviderURL, getSecurityProtocol, getUrlPkgPrefixes, setApplicationContext, setAuthentication, setCredentials, setInitialContextFactoryName, setJndiAuthAlias, setJndiContextPrefix, setJndiProperties, setName, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
-
Methods inherited from interface nl.nn.adapterframework.core.IConfigurationAware
getApplicationContext, getName
-
Methods inherited from interface nl.nn.adapterframework.core.INamedObject
getName, setName
-
Methods inherited from interface nl.nn.adapterframework.core.IScopeProvider
getConfigurationClassLoader
-
Methods inherited from interface nl.nn.adapterframework.core.ISender
sendMessageOrThrow
-
Methods inherited from interface nl.nn.adapterframework.core.ISenderWithParameters
consumesSessionVariable
-
-
-
-
Method Detail
-
configure
public void configure() throws ConfigurationException
Description copied from interface:ISender
configure()
is called once at startup of the framework in the configure method of the owner of this sender. Purpose of this method is to check whether the static configuration of the sender is correct. As much as possible class-instantiating should take place in theconfigure()
oropen()
method, to improve performance.- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceISender
- Overrides:
configure
in classJdbcQuerySenderBase<QueryExecutionContext>
- Throws:
ConfigurationException
-
getQuery
protected String getQuery(Message message)
Description copied from class:JdbcQuerySenderBase
Obtain a query to be executed. Method-stub to be overridden in descender-classes.- Specified by:
getQuery
in classJdbcQuerySenderBase<QueryExecutionContext>
-
openBlock
public QueryExecutionContext openBlock(PipeLineSession session) throws SenderException, TimeoutException
Description copied from interface:IBlockEnabledSender
open a resource that can be used multiple times whenIBlockEnabledSender.sendMessage(Object, Message, PipeLineSession)
is called.- Throws:
SenderException
TimeoutException
-
closeBlock
public void closeBlock(QueryExecutionContext blockHandle, PipeLineSession session)
Description copied from interface:IBlockEnabledSender
close the resource that is opened byIBlockEnabledSender.openBlock(PipeLineSession)
. It is important that this method is always called after processing with the blockHandle ends. It should effectively be called in a finally clause of a try around the openBlock.
-
closeStatementSet
protected void closeStatementSet(QueryExecutionContext statementSet)
- Overrides:
closeStatementSet
in classJdbcQuerySenderBase<QueryExecutionContext>
-
sendMessage
public SenderResult sendMessage(QueryExecutionContext blockHandle, Message message, PipeLineSession session) throws SenderException, TimeoutException
- Throws:
SenderException
TimeoutException
-
setQuery
public void setQuery(String query)
The SQL query text to be excecuted each time sendMessage() is called
-
setBatchSize
public void setBatchSize(int batchSize)
When set larger than 0 and used as a child of an IteratingPipe, then the database calls are made in batches of this size. Only for queryType=other.- Default value
- 0
-
getQuery
public String getQuery()
-
getBatchSize
public int getBatchSize()
- Overrides:
getBatchSize
in classJdbcQuerySenderBase<QueryExecutionContext>
-
-