Understanding the Database Binding Component

Understanding the Database Binding Component

The topics in this document provide information about Understanding the Database Binding Component.

What You Need to Know

These topics provide information about Database Binding Component.

About Database Binding Component

The Database Binding Component (DB BC) provides a comprehensive solution for configuring and connecting to databases that support Java Database Connectivity (JDBC) from within a Java Business Integration (JBI) environment. Database BC is a JBI component that provides database operations as services. JBI components acting as consumers invoke these Web Services. The Database BC is an implementation in compliance with JBI Specification 1.0.

The Database BC supports the following database artifacts to be exposed as Services.

Components of Database Binding Component

The Database BC helps users to handle databases with flexibility. It also provide Web Services in conjunction with other OpenESB components.

The following components are part of the Database BC.

Supporting Features in Database Binding Component

The Database BC has all the features of the JDBC Binding Component and subset of SQL Service Engine. The Database BC supports the listed database artifacts that are exposed as Services.

Open ESB Packages that Make Up the New Database Binding Component

This runtime component is available as a sun-database-binding.

The design-time components still leverage the org-netbeans-modules-wsdlextensions-jdbc.nbm. NetBeans Modules help create artifacts for the sun-database-binding. The artifacts that the new version of these components generate are deployed to the Database BC instead of the JDBC Binding Component or SQL Service Engine.

Database BC (DB BC) is a Java Business Integration (JBI) runtime component that provides a comprehensive solution for configuring and connecting to databases. Database BC provides data operations as Services. It supports the JDBC from within a JBI environment. Other JBI components invoke these Web Services acting as consumers. Database BC considers both Data Manipulation Language (DML) and Data Definition Language (DDL) operations as Web Services.

The services that the Database BC exposes are actually SQL operations on Table, Prepared Statements, and Procedures. The Database BC supports the following database artifacts to be exposed as Services.

The Database BC can assume the role of either a JBI consumer (polling inbound requests) or a JBI provider (sending outbound messages).

Database Binding Project

Once installed, the Database BC can be used to design, deploy, and run the Service Units. The most important part of a Service Unit is the WSDL that describes the Database services. Database BC provides a set of extension elements specific to Database BC for connecting to the Database.

Database Binding Component as Provider

Database BC acts as a provider in case of outbound message flow. Database BC acts as an external service provider when other engines and components 'invoke' it. In this role, when it receives a normalized message as part of the message exchange, it converts and extracts the SQL operation. The SQL operation is then executed on the specified database. In other words, when the Database BC acts as a JBI provider, it extracts the SQL query from a JBI message received from the JBI framework. It then executes the query on a specified database. It converts the reply from the database into a JBI message that other JBI components can service.

Database Binding Component as Consumer

Database BC also acts as a consumer incase of inbound functionality where Database BC polls for records from a particular table, converts them into normalized message, and sends to the Normalized Message Router (NMR). This process is analogous to the inbound connections implemented in CAPS 6. In other words, When the Database BC acts as a JBI consumer, it polls a specified database for updates to a table in the database. When a new record is stored in the table, the database polls for the record for the specified time interval and the Database BC picks up that record, constructs a JBI message, and sends the message to the JBI framework so it can be serviced by other JBI components.

Database Binding Component WSDL Extensibility Elements

The Database BC WSDL extensibility element is a template used to construct an instance of a Database BC WSDL. The Database BC WSDL extensibility elements contains information for constructing the Database BC message. These messages are constructed using the message parts, message formats, properties mapping, and other message related information necessary for the Database BC to properly map message exchanges to Database BC messages and vice versa. The Database BC WSDL extensibility elements also contain information about the database to which it connects.

Functional Architecture of Database Binding Component

The following figure shows the functional architecture of Database Binding Component.

High Level

The following table briefly describes the functional operation of each module or wizard.

Table 1 Functional Description

Function 

Description 

Installation Module

Installs, uninstalls, and manages the lifecycle of the Database BC. This module is used to plug the Database BC into the JBI Framework and monitor the lifecycle of the Binding Component such as install, uninstall, start, stop, and so on. 

Wizard Module

Assists in interacting with the database. 

  • The Database Wizard create/edit interface queries the database to build WSDL from Database Table, Procedures, and Prepared SQL Statements.

  • XSDs are created based on the Table, Procedures, and Prepared Statements in the external data source.

  • Database Operations are added to provide the appropriate database functionality.

  • The wizard assists in interacting with the database using JDBC API specific calls and ensures that appropriate methods are called and the data is formatted appropriately when manipulating the database.

  • The Database Wizard can create XSDs based on any combination of Table, Procedures or Prepared Statements.

  • The Database Wizard uses imported interfaces like the WSDL Editor and XSD Editor.

Wizard Launcher

Launcher the Database Wizard. This interface basically plugged in into the existing WSDL Editor Wizard. 

Schema Handler

Is responsible for creating an XML Schema for the corresponding table. The generated schema can be imported into the WSDL 

MetaData Handler

Gets the MetaData from the database and displays the data to the user through the wizard. MetaData consists of the user-specific description of the table. MetaData handler gets the MetaData of the TableColumns, Prepared Statements, and Procedures. This data is supplied to the schema generator module to generate the schemas. 

WSDL Generator

Generates the WSDL using imported APIs and the Schema Handler. 

Database BC Runtime

Provides the functionality for the Database BC at runtime. The Database BC receives the normalized message it gets from the NMR, denormalizes the message, and gathers the required parameters (JNDI name, Operations, and so on) from the message. It processes the parameter, normalizes the output, and sends it back to the NMR. 

Connection Handler

Provides the functionality to get the connection from different databases. This module uses the JMX API to create a connection pool and the JNDI name to obtain the connection from the data source or Java Naming API. This information is used to create JDBC resource and bind it to the JDBC context of the JNDI tree. The Connection Handler uses two methods to get connected to the database. If the user has already created the JNDI name and wants to establish a connection to the database, then the Connection Handler looks up the JNDI name in the JNDI context and gets the connection. If the given JNDI Name does not exists the Connection Handler binds as a new JDBC context to the JNDI tree during deployment time. In the second method, the Connection Handler establishes a connection using the connection parameters. (driver class name, URL, username, and password). 

Transaction Management

The Database BC implements the XAResource interface of JTA to be part of the global transaction and enlists the resource with the Transaction Manager. The Transaction Manager is responsible for starting and ending the XA Transaction. It implements the two-phase commit protocol to support the global transaction. 

JMX Interface

Provides a method to bind the Database BC context to the JNDI tree of an application server context. 

JBI Framework

Provides administration tools such as install, uninstall, deploy, and undeploy and normalized message router functionality to the Database BC. 

NetBeans Common Model

The Database BC uses the WSDL Editor and XSD Editor imported models from the NetBeans as part of the enterprise pack. 

Functional Architecture of the JDBC Binding Component — Comparative Study

The following figure depicts the functional architecture of the Database BC including various logical components and external systems. The diagram is centered around the external and internal interfaces provided by the binding component. The term interface is used in a generic sense to mean any piece of information going back and forth between components.

The architecture includes the following:

Functional Architecture