Chapter 6. Using Host Publisher Studio to develop J2EE applications 173
6.4 Creating a Database Access Integration Object
Use the Database Access application to create Integration Objects that encapsulate a
database statement. To create the Integration Objects, you specify your structured query
language (SQL) statement. If you are querying a database, you specify the data you want to
retrieve from the database table.
6.4.1 Integration Objects overview
Integration Objects are JavaBeans. They encapsulate interactions with data sources like
database applications and return desired data as JavaBean properties. These objects can
also be embedded within JavaServer Pages, which allow you to use a Web browser to
interact with the data.
JavaBeans can be invoked from a Java applet, from a Java servlet, from a Java application, or
from a JavaServer Page. For example, Figure 6-30 illustrates how a Web browser requests a
JSP that invokes a database Integration Object to access the DB2 UDB for iSeries database.
Figure 6-30 JavaBeans: Database Integration Objects
Notice that, in this scenario, the JSP has to be compiled into a Java servlet the first time it is
used. In turn, the created Java servlet must be also compiled into Java bytecodes for
execution. This process creates a small overhead the first time the JSP is used, but gives you
the benefit of not having to write a Java servlet to instantiate the database Integration Object.
The Database Access application (part of the Host Publisher Studio) can easily create the
database Integration Object, and the Host Publisher Studio Application Integrator can create
the JSP execution page.
Retrieving information from a database
The Database Access wizard helps you navigate to the tables that contain the data you want,
specify conditions to identify the data, and sort the data you want to publish.
You can specify the SQL statement type and select the tables in the database to access. You
can determine which columns of the tables to include, applying conditions to the data in the
columns. You can also sort the order in which the data is displayed.

Get iSeries Access for Web V5R2 and WebSphere Host Publisher V4.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.