You can connect to numerous databases, and in a variety
of ways. This section shows some of the options.
Introduction
You might have databases that
you want to use as service providers. Alternatively, you might want
to use a database to trigger a service request, or use a database
to add details to a service request, before the request is sent to
the service provider.
You can use adapters to access databases
as service endpoints, and you can use mediation modules to update
service requests with information from databases.
The WebSphere Adapter for JDBC
Generally,
if you want to use a database as a service requester, or a service
provider, you use an adapter.
The WebSphere® Adapter
for JDBC is a JCA adapter that can be used with any database that
has a JDBC driver supporting the JDBC 2.0 specification, or a later
specification. For example: DB2®, Oracle, Microsoft® SQL
Server, Sybase, and Informix®. The JDBC adapter
supports inbound and outbound processing. For
more information on the WebSphere Adapter for JDBC,
see
.
EIS imports
and exports let you connect from WebSphere ESB,
or WebSphere Process Server, to resource adapters
such as the WebSphere Adapter for JDBC. With an EIS
import, a service requester can access a database or call a program
on an enterprise information system (EIS) system. With an EIS export,
an EIS application can call a service provider on another system.
Connect using a JCA adapter: databases as service
providers
You can connect to any database that has a JDBC
driver supporting the JDBC 2.0 specification, using the WebSphere Adapter
for JDBC. WebSphere ESB and WebSphere Process
Server can convert data between the business objects that the JDBC
adapter outputs, and the interface that the service requester expects.
This
solution gives you flexibility and scalability: the JDBC adapter can
be replaced with a different type of adapter or binding if the service
provider changes.
Figure 1. Using a WebSphere JDBC
adapter
Connect using a JCA adapter: triggering service requests
from database events
You can set up database trigger events
and use them to trigger Web services:
- Events are triggered by records being written to a database table.
- The JDBC adapter gets the event output and creates business objects.
Business objects are containers for application data that represents
business elements, such as a database table or the result of an SQL
query. The adapter understands the data format provided by the application,
and can process the data, perform the operation, and send the results
back in that format.
- WebSphere ESB, or WebSphere Process
Server, can convert the business objects to a format that the Web
services interface expects.
Figure 2. Using a JDBC adapter
Connect using a mediation module: updating service
requests using databases
You can access databases while
service requests are flowing through WebSphere ESB
or WebSphere Process Server.
For example,
you might want to update messages with data from a database, or log
part of a message to a database. To do this you can use the mediation
primitives that are the building blocks of mediation modules.
- The Database Lookup mediation primitive lets you look up information
in a database table, and store the information in the message being
processed.
- The Message Logger mediation primitive lets you log a message
to a database. The schema used for the table that the message is logged
to, is fixed. Typically, database create or update operations that
need more flexibility would use a JDBC adapter.
- The Service Invoke mediation primitive lets you call a service
endpoint. The service endpoint can be an EIS system, if you use a
reference and an EIS import. You can create an EIS import using the WebSphere Integration Developer external
service wizard, and a resource adapter such as the WebSphere Adapter
for JDBC.
For more information on the mediation
primitives, see:
.
Figure 3. Using mediation
primitives inside a mediation module