Skip to main content
Skip table of contents

JDBC Connector

The adapter connects to a JDBC-compatible database and executes one or multiple database statements handed over as input XML document with an adapter-specific structure.

Note:

The connector requires a JDBC datasource that has been deployed within the application server and for which the connection URL, credentials, schema and transaction behavior etc. are defined. For further information on deploying JDBC datasources consult your application server's documentation.

Properties

Operation

Defines the operation executed by the function adapter

Possible values: execute : Execute the function adapter

Parameters

Adapter

Main adapter class (do not change!)

Possible values: de.softproject.integration.adapter.jdbc.DB: Main class (Default)

JndiName

JNDI name of the DataSource

Note:

If the connection is established via the JNDI name, the parameter connectionURL must not be specified.

Possible values: Valid JNDI name (e. g. java:/DefaultDS )

ColumnCase

Controls how column names of the result set are copied into the result XML document. Since databases have different behaviour regarding the case of columns in the result set, the processing of the output of this adapter can become independent of that behaviour by using the ColumnCase parameter.

Possible values:

  • NO_CHANGE : Does not change the column names, i. e. the column names will be written to the result document as returned by the database (Default)

  • TO_LOWER : Changes the column names to lower case
  • TO_UPPER : Changes the column names to upper case

Column names, which are illegal xml element names (NCNAME) are converted to _<number> (e. g. _2 ) where <number> is the column index.

connectionURL

Connection URL for the JDBC database


Note:

If the connection is established via the connection URL, the parameter JndiName must not be specified.


Possible values:

  • The URLs structure depends on the database to which a connection is to be established.
  • Example for sqlite:  jdbc:sqlite:C:/Temp/mydatabase.db
userUser name for authentication via the parameter connectionURL
passwordPassword for authentication via the parameter connectionURL
rootElementName

Name of the root element of the output

Possible values: String that is valid for XML element names. Default:  Data

CommitMode

Defines the version to be used for commits

Possible values:

  • NONE : Do not execute any commit

  • AUTO : Automatic commit according to the JDBC API (i. e. after each batch) (Default)

  • STATEMENT : Explicit commit after each statement (i. e. after all batches for this statement)

  • DOCUMENT : At the end of the document (i. e. after executing all statements)

  • MANAGED : Use adapter in transactions (for externally managed transactions)

AddMetaDataForQueries

(with X4 4.1 Revision 32408 or higher) Controls whether database metadata should be output for each result set in the result XML document of the adapter, when an SQL query is executed (not available for UPDATE, DELETE etc.). In the JDBC adapter's batch mode (StatementBatch, PreparedStatementBatch, and CallableStatementBatch) this function is also not available.

Possible values:

  • true : Add database metadata to result document

  • false : Output result document without database metadata (Default)

Status values

1

The query has returned data records or the instruction has changed data records.

The status 1 is returned, if the document contains multiple queries or instructions and at least one query has delivered or changed a result.

0

The query did not return any results or the statement hasn't changed any data records.

The status 0 is returned, if the document contains multiple queries or instructions and no query has returned or changed a result.

-1

Technical error: more information on the error cause can be found in the server log.

Input

The JDBC Connector excepts specific input XML structures containing database statements. These input XML structures can be generated dynamically by using XSL mappings that depend on the processed XML data.

Note:

If you use characters within the SQL statement or for the values or data of the table columns that have a meaning in XML, mask the SQL statement with surrounding CDATA block, e.g. <![CDATA[ UPDATE PROCESS SET X4_VERSION=4 WHERE X4_DURATION=100 ]]> or <rowset><row><name><!CDATA[ XML character “<“ in CDATA element]]></name></row></rowset>.

This ensures that the characters in the CDATA element are not interpreted as XML, but as data for the adapter.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.