DB2 Connect Quick Beginnings for Linux**

Working with DB2 Data

DB2 is a relational database system rich in features, many of which can be accessed remotely. In addition to allowing you to store your data, DB2 lets you issue requests to administer, query, update, insert, or delete data using local or remote client applications.

Accessing Host or AS/400 DB2 Data using DB2 Connect Personal Edition

A Direct connection without intermediate servers is a very convenient and desirable configuration. This is especially true for situations where the host or the AS/400 database server supports TCP/IP connectivity (for example, DB2 for OS/390 V5.1, or DB2 for AS/400 V4R2, or DB2 for VM 6.1). In such a configuration, each DB2 Connect workstation establishes a direct TCP/IP connection to DB2 for OS/390 or, for platforms with integrated SNA Support, connects via APPC to DB2 for MVS and other host and AS/400 databases.

TCP/IP connectivity requires that the host or AS/400 database support TCP/IP. DB2 for OS/390 V5.1, DB2/400 V4R2, and DB2 for VM V6.1 support native TCP/IP connections. An alternative to native TCP/IP is MPTN connectivity. MPTN connections require that IBM AnyNet products be installed on the target database system, but do not require the host or AS/400 database to provide native TCP/IP support.

Figure 1 shows a workstation, with DB2 Connect Personal Edition installed, directly connected to a host or AS/400 database server.

Figure 1. Direct Connection Between DB2 Connect and a host or AS/400 database server


Figure sqlpecn1 not displayed.

In this environment, if you are using Windows 32-bit operating systems you can use the DB2 Connect Personal Edition Integrated SNA Support to connect directly to the host or AS/400 servers. DB2 Connect Integrated SNA Support permits connections over a variety of local and wide area networks, such as Token-Ring, Ethernet, SDLC, Twinax, Coax and Asynchronous dial-up.

The DB2 Connect Integrated SNA Support implements both APPC and MPTN connections over networks using hosts and AS/400 systems that have IBM AnyNet products installed. Users of OS/2 workstations can use IBM Personal Communications for OS/2, or IBM Communications Server for OS/2 to achieve direct APPC and MPTN connectivity.

Connections via Communications Gateway

Some organizations prefer to concentrate access to SNA networks through dedicated SNA Gateways, such as IBM eNetwork Communications Server, Microsoft SNA Server, or Novell Netware for SAA. DB2 Connect products support connections through gateways, so this can be a good choice if you need terminal emulation and other SNA services not provided by DB2 Connect. Figure 2 illustrates such a situation.

Figure 2. Indirect Connection to host or AS/400 database server via SNA Communications Gateway


Indirect Connection to host or AS/400 database server via SNA Communications Gateway

If you have many workstations that require access to your DB2 host or AS/400-based data sources, then you may want to use DB2 Connect EE with DB2 Clients, instead of DB2 Connect PE on every machine. DB2 Connect Enterprise Edition can be installed on the same machine as IBM eNetwork Communications Server or Microsoft SNA Server, and in many cases it can provide a less expensive and better-performing solution.

Contact your authorized IBM reseller for additional information about DB2 Connect Enterprise Edition.

Accessing Host or AS/400 DB2 Data from the Desktop using DB2 Connect Enterprise Edition

A DB2 Connect server enables DB2 clients on a LAN access to data that is stored on host or AS/400 systems. DB2 Universal Database Enterprise Edition and DB2 Universal Database Enterprise - Extended Edition include the DB2 Connect Server Support component. All references to DB2 Connect Enterprise Edition also apply to the DB2 Connect Server Support component.

A great deal of the data in many large organizations is managed by DB2 for AS/400, DB2 for MVS/ESA, DB2 for OS/390, or DB2 for VSE & VM. Applications that run on any of the supported platforms can work with this data transparently, as if a local database server managed it. DB2 Connect Enterprise Edition is required for supporting applications which access host or AS/400 data and exploit transaction monitors (for example, IBM TxSeries CICS and Encina Monitor, Microsoft Transaction Server, BEA Tuxedo) as well as applications that are implemented as Java applets.

In addition, you can use a wide range of off-the-shelf or custom-developed database applications with DB2 Connect and its associated tools. For example, you can use DB2 Connect products with:

DB2 Connect Enterprise Edition is most appropriate for environments where:

DB2 Connect provides transparent access to host or AS/400 data through a standard architecture for managing distributed data. This standard is known as Distributed Relational Database Architecture (DRDA). DRDA allows your applications to establish a fast connection to host and AS/400 databases without expensive host components or proprietary gateways.

Although DB2 Connect is often installed on an intermediate server machine to connect DB2 clients to a host or AS/400 database, it is also installed on machines where multiple local users want to access the host or AS/400 servers directly. For example, DB2 Connect may be installed on a large machine with many local users.

DB2 Connect may also be installed on a Web server, Transaction Processor (TP) monitor, or other 3-tier application server machines with multiple local SQL application processes and threads. In these cases, you can choose to install DB2 Connect on the same machine for simplicity, or on a separate machine to off-load CPU cycles.

A DB2 Connect server enables multiple clients to connect to host or AS/400 data and can significantly reduce the effort that is required to establish and maintain access to enterprise data. Figure 3 illustrates IBM's solution for environments in which you want to use a DB2 client making an indirect connection to a host or AS/400 database server through DB2 Connect Enterprise Edition.

In the example, you could replace the DB2 Connect server with a DB2 server that has the DB2 Connect Server Support component installed.

Figure 3. DB2 Connect Enterprise Edition


Diagram showing clients connection to host and AS/400 databases through DB2 Connect Enterprise Edition.

Figure 4. Using Transaction Monitors with DB2 Connect


Transaction monitors such as Encina work with DB2 Connect

Figure 5. Java Server Support


Websphere and Java server functionality in DB2 Connect

Figure 6. DB2 Connect working with Microsoft Internet Information Server (IIS)


Microsoft IIS server with DB2 Connect

Accessing DB2 Data from the Web using Java

Java Database Connectivity (JDBC) and Embedded SQL for Java (SQLJ) are provided with DB2 to allow you to create applications that access data in DB2 databases from the Web.

Programming languages containing embedded SQL are called host languages. Java differs from the traditional host languages C, COBOL, and FORTRAN, in ways that significantly affect how it embeds SQL:

The DB2 JDBC Applet server and the DB2 client must reside on the same machine as the Web server. The DB2 JDBC Applet server calls the DB2 client to connect to local, remote, host, and AS/400 databases. When the applet requests a connection to a DB2 database, the JDBC client opens a TCP/IP connection to the DB2 JDBC Applet on the machine where the Web server is running.

Figure 7. Using Java Applets


JDBC and DB2 Connect

JDBC and SQLJ applications can be run from any system that has a DB2 client installed; a Web browser and a Web server are not required.

For more information on Java enablement, refer to the DB2 Java Enablement web page at http://www.ibm.com/software/data/db2/java/

For more information on the JDBC API, point your browser to http://splash.javasoft.com/

Accessing DB2 Data from the Web using Net.Data

Net.Data is provided with DB2 to allow you to create applications that access data in DB2 databases from the Web. You can use Net.Data to create applications that are stored on a Web server and viewable from any Web browser. While viewing these documents, users can either select automated queries or define new ones that retrieve the specified information directly from a DB2 database.

Automated queries do not require user input; they are links in an HTML document and, when selected, they trigger existing SQL queries and return the results from a DB2 database. These links can be triggered repeatedly to access current DB2 data. Customized queries require user input. Users define the search characteristics on the Web page by selecting options from a list or by entering values in fields. They submit the search by clicking on a push button. Net.Data uses the information that is supplied by the user to dynamically build a complete SQL statement, and it sends the query to the DB2 database.

A demonstration of Net.Data applications is available from the IBM Software Net.Data page at http://www.ibm.com/software/data/net.data

Net.Data can be installed with a:

In both cases, Net.Data and the Web server must be installed on the same system.

Figure 8. Net.Data with DB2 Connect


Net.Data working with DB2 Connect


[ Top of Page | Previous Page | Next Page ]