Show TOC Start of Content Area

Function documentation Configuring the Sender JDBC Adapter  Locate the document in its SAP Library structure

Use

You need to configure the sender JDBC adapter to be able to send content from databases to the Integration Server or to the PCK.

Adapter Work Method

·        You must add an indicator that specifies the processing status of each data record in the adapter (data record processed/data record not processed) to the database table.

·        The UPDATE statement must alter exactly those data records that have been selected by the SELECT statement. You can ensure this is the case by using an identical WHERE clause. (See Processing Parameters, SQL Statement for Query, and SQL Statement for Update below).

·        Processing can only be performed correctly when the Transaction Isolation Level is set to repeatable_read or serializable.

Example

SQL statement for query: SELECT * FROM table WHERE processed = 0;

SQL statement for update: UPDATE table SET processed = 1 WHERE processed = 0;

processed is the indicator in the database.

Integration

You configure the adapter on the Parameters tab page during the definition of a communication channel in the Integration Server or in the PCK. In addition to the adapter configuration, you can use the Module tab page to specify generic modules in the module processor, which give the adapter additional functions.

Condition for Sender Agreement

The adapter determines the payload of the XI message according to how it is configured. However, the message header information is determined from the corresponding sender agreement for the communication channel.

The following conditions apply to the adapter for the definition of the sender agreement:

·        The communication channel defined here must have exactly one sender agreement.

·        At least the interface name and the sender service must be qualified in the sender agreement. All other fields are optional in accordance with the general rules for defining sender agreements.

Prerequisites

       1.      You have created a new communication channel or have opened an existing one.

       2.      On the Parameters tab page you have selected the adapter type JDBC.

       3.      You have selected the Sender radio button to define the adapter as a sender adapter.

Activities

Transport Protocol

The transport protocol is JBDC 2.0.

Message Protocol

JDBC

Subsequent versions may permit additional values.

Adapter Engine

Select the Adapter Engine on the Integration Server, or select a non-centrally installed Adapter Engine. This selection is not available in the PCK.

Connection Tab Page

Database Connection

Field

Entry

JDBC Driver

Java class of the JDBC driver that the JDBC adapter must load to be able to access the driver.

The specification varies according to the JDBC driver; see material from the respective provider for exact details.

Connection

Address with which you can establish a database connection using the JDBC driver.

The specification varies according to the JDBC driver; see material from the respective provider for exact details.

User Name

User for the database to be read.

Password

Password for the database to be read, including confirmation.

Processing Tab Page

Specify the following processing parameters:

Parameter

Entry

Quality of Service

Specifies how the Integration Server/PCK should process a message.

Best Effort

(synchronous processing)

Exactly Once

(asynchronous processing)

Exactly Once In Order

(Asynchronous processing using queues. This means execution exactly once following the sequence of successive messages.)

Specify the Queue Name.

Poll Interval (secs)

Number of seconds that the adapter must wait if no files are found for processing.

Poll Interval (msecs)

Additional waiting time in milliseconds.

If Poll Interval (Sec.) is set to null, processing times will be short and close to real time.

If Poll Interval (secs) and Poll Interval (msecs) are set to null, the adapter is only called once.

Retry Interval (secs)

Number of seconds that the adapter is to wait before a SQL statement processed with errors is processed again.

Note

If no value is specified, the value from Poll Interval (secs) is used.

Query SQL Statement

You have the following options:

·        Specify a valid SQL SELECT statement to select the data to be sent from the specified database.

·        Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.

The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs.

Document Name

The document name is inserted in the message as the main XML tag. The default value is resultset.

Document Namespace

The namespace is added to the document name.

Example

See the example below.

Update SQL Statement

You have the following options:

·        Enter a valid SQL statement that is to be applied to the database once the data (determined from the Query SQL Statement) has been successfully sent to the Integration Server/PCK.

It must be an INSERT, UPDATE, or DELETE statement.

·        In place of the SQL statement, you can also enter <TEST>. Once the data determined from Query SQL Statement has been successfully sent, the data in the database remains unaltered.

This is recommended if the data has not only been read, but also changed by a stored procedure entered under Query SQL Statement.

Run Operating System Command

·        Command line

Specify an operating system command that is to be executed following successful database operations.

·        Timeout (secs.)

This specifies the maximum runtime of the executing program in seconds. When this time interval is exceeded, the adapter continues processing. The executing program continues to run in the background.

·        Terminate Program After Timeout

Set this indicator when the adapter is to terminate the executing program in the event of a timeout.

The adapter writes the output (STDOUT and STDERR) for the operating system command in the system trace.

Note

Message processing is independent of any errors that occur during the execution of a configured operating system command.

Advanced Tab Page

Adapter Status

Set the adapter to Active to enable messages to be exchanged.

Advanced Mode

To specify additional parameters in the adapter configuration, set the Advanced Mode indicator.

Transaction Isolation Level

There are different levels of database transactions known as isolation levels. The isolation level determines how transactions running in parallel can influence each other. The options correspond to the JDBC constants:

·        Default (default setting of the respective database)

·        None

·        read_uncommitted (weakest setting)

·        read_committed

·        repeatable_read

·        serializable (strongest setting)

Caution

You must only lower the isolation level where necessary and as far as necessary. To avoid data inconsistencies in the database when the isolation level is lowered, ensure that multiple database transactions cannot access the database simultaneously.

Database Auto-Commit-Enabled (No Transaction Handling)

Set the indicator if you want to deactivate the logical unit of work, which the JDBC adapter requires to guarantee that the data in the database is consistent.

This option is required for JDBC drivers that do not support transactions. To avoid data inconsistencies in the database when the isolation level is lowered, ensure that multiple database transactions cannot access the database simultaneously.

Caution

Do not set this indicator if the JDBC driver supports transactions.

Disconnect from Database After Processing Each Message

Set this indicator if the database connection is to be released and reestablished before every poll interval.

Remove Empty Tags

Set this indicator if you want to remove the empty tags from the resultset of the sender adapter and thereby help reduce the size of XML documents.

This graphic is explained in the accompanying text

If this indicator is not set, the resultset looks as follows:

<resultset>

<row>

<column-name1>column-value</ column-name1>

<column-name2></column-name2>

<column-name3>column-value</ column-name3>

<column-name4></column-name4>

</row>

<row>

<column-name1>column-value</ column-name1>

<column-name2></ column-name2>

</row>

</resultset>

 

If this indicator is set, the resultset looks as follows:

<resultset>

<row>

<column-name1>column-value</ column-name1>

<column-name3>column-value</ column-name3>

</row>

<row>

<column-name1>column-value</ column-name1>

</row>

</resultset>

Table

Specify the parameter names and parameter values in the table.

Note

Additional parameters are published in SAP Note 801367.

Example

The system converts the table resulting from the query SQL statement into a valid XML document and sends it to the Integration Engine. The document looks like this:

<resultset>

<row>

<column-name1>column-value</ column-name1>

<column-name2>column-value</ column-name2>

<column-name3>column-value</ column-name3>

</row>

<row>

<column-name1>column-value</ column-name1>

<column-name2>column-value</ column-name2>

<column-name3>column-value</ column-name3>

</row>

</resultset>

 

 

 

End of Content Area