PreviousTOCNext

JDBC Based Network Services

The JDBC API supports both models for database access: two-tier (direct database access) and three-tier (communication with the database over a "middle-tier" on the database server or a separate machine). In each case you have to install a JDBC driver, which translates the Java JDBC calls into an appropriate protocol. [2]

Two Tier Systems

In the two-tier model, a Java applet or application talks directly to the database. The Java Applet provides a uniform presentation layer that communicates with a data storage layer. This requires a JDBC driver that can communicate with the particular database management system being accessed. In addition the Database must be on the Web server due to an Applets "sandbox" restriction. A user's SQL statements are delivered to the database, and the results of those statements are sent back to the user. This is referred to as a client/server configuration, with the user's machine as the client, and the machine housing the database as the server. Most client/server systems today are two-tiered, Visual Basic applications being one example of a typical two-tiered client/server environment. With the two-tiered model all the processing logic is on the client and just the DBMS runs on the server. [3] [10] [13]

Two-tiered applications work well if the Internet application is meant to do simple data processing like forms entry. If the application has more complex business rules, the Applet can become so "heavy" that the browser must download lots of classes to handle all the business rules to the browser client. This starts to move back into the "fat" client paradigm that the Internet was suppose to solve. In addition you may have a significant upload time to get all the classes to the browser client. [10]

Three Tier Systems

In the three-tier model, the application is broken up into logical software tiers. [10] [13]

  1. Presentation Logic
  2. Application server containing the business rules - the "middle tier"
  3. Data input/output that interacts with a file system or DBMS

In this model, commands are sent to a "middle tier" of services by the presentation layer. This "middle" tier performs the necessary business logic, which then may send SQL statements to the database. The database processes the SQL statements and sends the results back to the middle tier. The middle tier may perform some additional processing on the data, then send the results to the presentation tier. [13]

Many MIS directors find the three-tier model very attractive because the middle tier makes it possible to maintain control over access and the kinds of updates that can be made to corporate data which are shared by multiple applications. [3]

Three tiers are typically marketed as having the following benefits: [10] [13]

  • maximizes object reuse
  • can yield performance improvements
  • systems are more easily developed
  • maintenance is simplified
  • application design is more intuitive
  • more flexibility regarding the data model
  • wider choice of management tools
  • less lock-in to a single DBMS vendor

Until now the middle tier has typically been written in languages such as C or C++, which offer fast performance. However, with the introduction of optimizing compilers that translate Java bytecode into efficient machine-specific code, it is becoming practical to implement the middle tier in Java. This is a big plus, making it possible to take advantage of Java's robustness, multi-threading, and security features. JDBC is important to allow database access from a Java middle tier. [3]

Middleware

Middleware is the glue that allows the different logical layers or tiers to communicate with one another. There are many middleware products available. Gartner group defines two basic types: [13]

  1. Database Management Middleware: these are products that provide application-to-DBMS or DBMS-to-DBMS services. Examples include Oracle's SQL*NET, Novell Netware, and Information Builders EDA/SQL.
  2. Program-to-Program Middleware: which is basically message passing. Examples include sockets, Java RMI, ORB's (Object Request Broker), and Tuxcedo.

Because of the complexity and variety of systems developed today any environment is likely to have a wide mix of middleware products. When building Java based systems the most likely middleware mechanisms will be RMI, HTTP, Sockets, and IIOP. [3] [13]

Communication Between Tiers

So now we have many different tiers. What communication mechanism is used between these tiers? For Java based systems there are several possible today - and more to come. These include: Remote Method Invocation, Sockets, and HTTP. In the near future as the Java environment continues to evolve there will also be interoperability with the CORBA world via IIOP (Internet Inter-ORB Protocol). Each of these types of communications are outlined below.

Remote Method Invocation

Remote Method Invocation (RMI) allows Java objects on different systems (or hosts) communicate with each other. A remote object implements a remote interface which defines which of the objects methods can be invoked remotely. Clients of the remote object can then invoke the methods of the remote object as if they were invoking local methods on a local object. [10] [11]

One of the largest benefits for RMI is that it allows you to pass objects between the client and the service. The object here refers to all the attributes, methods, and data contained in an object. Most remote communication mechanisms only allow you to pass the data - and often that data must go through a conversion from one environment to the next.

IIOP - Internet Inter-ORB Protocol

IIOP is a transport protocol which is part of the Object Management Group's Common Object Request Broker Architecture (CORBA) for distributed computing. IIOP defines a standard set of message contents, formats and semantics for transmitting requests and replies between objects. This is a comprehensive system through which objects request services from one another across the wide variety of platforms or database systems. IIOP offers many other advantages, including scalability, code reuse, and proven implementations. IIOP makes it possible to develop a programming function once (i.e., an "object") and then expose it to the rest of the company. Developers can reuse objects through standard Interface Definition Language (IDL) interfaces. [7] [16] [17] [18]

This is very similar to the Java RMI environment. Java RMI will include the capability to communicate with other objects using IIOP as the transport mechanism in addition to the native Java transport. IIOP support in Java will allow Java to any platform object communication. [16] [17]

HTTP

HTTP (HyperText Transport Protocol) is the protocol for communications between Web browsers and servers. It specifies how a client and server establish a connection, how the client requests data, how the server responds, and finally how the connection is closed. HTTP uses sockets (outlined below). The current standard is HTTP 1.1. [11]

Sockets

Socket communication has been around along time. Sockets basically allow a programmer to treat the network connection as a stream of bytes. It is a low-level communication facility that has been wrapped with higher level API's. Even with high level API's you must often deal with the low-level communication issues such as error handling and retries. With sockets both the client and server must be available for communication to take place. There are many good models and facilities which use socket programming. [11] [13]

With sockets you have a server which listens for a clients request, pulls the data off the connection, processes the data and optionally returns some result. Sockets require several more steps in order to perform remote communication then do distributed object specifications like RMI and CORBA. [10] [11]

PreviousTOCNext

Return to Gerber Family Home Page
directNIC Search
Hosted by directNIC.com