Académique Documents
Professionnel Documents
Culture Documents
Objectives
After completing this session, you will be able to:
JDBC Adapter
JDBC Adapter
Type JDBC
Exactly one sender agreement
per Communication channel
(1:1)
At least interface name and
sender service must be
qualified in the sender
agreement
sender means that a database provides information that are queried (via SELECT statement)
and send to XI integration server
Prerequisite for using the JDBC adapter is of course access to a database system like
SAP DB or MS SQL server or any database that provides a JDBC driver
An appropriate JDBC driver must be deployed on the system. See XI Configuration Guide
for more information
Be sure that in SQL Server authentication mode is set to mixed mode.
Right click your DBMS Server in Enterprise Manager Tool and select properties
->security-> choose SQL server and windows authentication
a sender agreement is needed for using a jdbc sender communication channel
To configure a complete roundtrip you could define a file receiver channel where
the message is delivered to
Routing rules and receiver has to be specified as for any other channel in the directory
object model
In the case of a JDBC sender, the database table is queried via a SELECT
statement.
The message is by definition asynchronous hence the QoS should be set as EO or
EOIO.
XML resultset
<?xml version="1.0" encoding="utf-8"?>
<resultset>
<row>
<Index>1</Index>
<artNumber>3334</artNumber>
<description>Athlon XP 2300+</description>
<quantity>4</quantity>
<new>true</new>
</row>
<row>
<Index>2</Index>
<artNumber>1222</artNumber>
<description>INTEL P4 3200</description>
<quantity>2</quantity>
<new>true</new>
</row>
<row>
<Index>3</Index>
<artNumber>3222</artNumber>
<description>Athlon64 3200</description>
<quantity>10</quantity>
<new>true</new>
</row>
<row>
<Index>4</Index>
<artNumber>3223</artNumber>
<description>Athlon64 3400</description>
<quantity>5</quantity>
<new>true</new>
</row>
</resultset>
SAP AG 2004, JDBC Adapter, Dennis Kropp, 9
receiver means that data is written into a database via XI JDBC adapter
Prerequisite for using the JDBC adapter is of course access to a database system like
SAP DB or MS SQL server or any database that provides a JDBC driver
An appropriate JDBC driver must be deployed on the system. See XI Configuration Guide
for more information
Be sure that in SQL Server authentication mode is set to mixed mode.
Right click your DBMS Server in Enterprise Manager Tool and select properties
->security-> choose SQL server and windows authentication
To configure a complete roundtrip you could define a file sender channel where
the message is send from
Routing rules and sender has to be specified as for any other channel in the directory
object model
For the JDBC receiver, the message can be sent synchronously or asynchronously.
In the case of a SELECT statement, only a synchronous request makes sense, of
course (Best effort), since the result set will be returned.
In the case of other statements (UPDATE, INSERT, DELETE), if the message
was sent synchronously, then the response will contain the number of rows
affected.
10
11
12
This represents the canonical XML format used to represent SQL statements to be processed by
the JDBC receiver adapter.
This canonical format can be used to represent the SQL statements of type
SELECT,INSERT,UPDATE,DELETE as well as calls to SQL procedures.
The metadata depends on the structure of the target table(s). It should be defined at design-time as
an Interface Object in the Integration Repository (the Interface objects for this XML canonical
format are not predefined in the Integration Repository by SAP).
The advantage of this canonical format is that it presents a message-oriented view of the SQL
statement (easier for mappings). It is independent of the JDBC driver and the database vendor.
If you use the optional <table> element, the value specified here is used as a database table name.
This enables you, for example, to define table names, which contain non-XML-compatible
characters or characters that stop them from being used in interface definitions in the Integration
Builder.
<StatementName> can have a arbitrary name
<dbTableName action=INSERT> replace dbTableName by the name of your table if you do not
use <table> element
action=INSERT
Statements with this action cause existing table values to be inserted. Therefore, the statement
corresponds to an SQL INSERT statement.
The block <access> contains the new column values.
A statement with the action INSERT must have at least one <access> element. It cannot have a
<key> element.
The corresponding SQL statement for StatementName in the example above is as follows:
INSERT INTO dbTableName
(col1) VALUES(val11)
13
14
The tag <Product is mapped to <access> so for each <Product> tag in source a
<access> tag is created in target structure
The attribute action is mapped with a constant value INSERT
The tag <new> is mapped with a constant value true
Each <access> tag means one INSERT statement in jdbc adapter
15
16
17
Result: data in DB
18
Summary
19