Skip to main content
Version: 8.2411.x.x RR

JDBCExecuteStatementDataSink

The JDBCExecuteStatementDataSink is used to execute an arbitrary SQL statement. The statement is compiled when the data sink is opened. Parameters can be used to fine tune the runtime behavior. The parameter values are deferred expression which are evaluated when an object is exported. This module is tested with the JDBC drivers for Oracle, PostgreSQL and MariaDB databases, so it officially only supports MariaDB and Oracle databases.

Configuration

NameType, usage constraints, defaultsDescription
statementrequired: paraVal
default: none
type: string
The SQL statement to execute. Use "?" for placeholders of parameters.
statementParameteroptional: paraList
default: none
type: list of values
Values for every question mark parameter given in the statement clause.
datasourcerequired: paraVal
default: none
type: javax.sql.DataSource
A reference to a javax.sql.DataSource object. It defines either a JDBCConnectionPool defined in some initialization section of the configuration file or it refers to a javax.sql.DataSource provided programmatically by the client application and which is put into the configuration registry.
autoCommitoptional: paraVal
default: false
type: boolean
Determines whether a transaction is automatically committed after the export of the entity.

Example

<dataSink type="JDBCExecuteStatementDataSink">
<dp:paraVal name="statement" value="INSERT INTO person SELECT * FROM candidate WHERE ID=?" />
<dp:paraList name="statementParameter">
<value>#{in.candidate.id}</value>
</dp:paraList>
<dp:paraVal name="datasource" value="${inst.ds}"/>
</dataSink>