Java Reference
In-Depth Information
using a local RDBMS or a multitier EJB based architecture. In either case,
completely transparent persistence is achieved.
Two-Tier Model
In the two-tier model, a Java application is designed to interact directly with a
database. Application functionality is divided into these two layers:
 
Application layer, including the JDBC driver, business logic, and user interface
 
Database layer, including the RDBMS
The interface to the database is handled by a Java Database Connectivity (JDBC)
Driver appropriate to the particular database management system being accessed.
The JDBC Driver passes SQL statements to the database and returns the results of
those statements to the application.
A client/server configuration like the one shown in Figure 1-2 is a special case of the
two-tier model, where the database is located on another machine, referred to as the
server. The application runs on the client machine, which is connected to the server
over a network. Commonly, the network is an intranet, using dedicated database
servers to support multiple clients, but it can just as easily be the Internet.
Figure 1-2: A two-tier client/server configuration is typical of office applications.
Part II of this topic illustrates the use of basic JDBC and SQL functionality in the
context of a basic two-tier application. That application uses simple Swing
components to create a generic RDBMS graphical user interface (GUI). The inherent
flexibility of a Java/JDBC approach to developing database applications enables you
to access a wide range of RDBMS systems, including Oracle, Sybase, SQL Server,
and MySQL, as well as MS Office applications, using this GUI.
Three-Tier Model
In the three-tier model, the client typically sends requests to an application server,
forming the middle tier. The application server interprets these requests, and formats
the necessary SQL statements to fulfill these requests, and sends them to the
database. The database processes the SQL statements and sends the results back
to the application server, which then sends them to the client.
Search WWH ::




Custom Search