Java Reference
In-Depth Information
The JDBC API can be used directly from your application or as part of a multi-tier
server application as shown in the next section .
Two-Tier and Three-Tier Models
The JDBC API supports both two-tier and three-tier models for database access. In
other words, JDBC can either be used directly from your application or as part of a
middle-tier server application.
Two-Tier Model
In the two-tier model, a Java application interacts directly with the database.
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 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.
Figure 4-1: Two-tier client/server configuration
A client/server configuration 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.
Part II of this topic illustrates the use of basic JDBC and SQL functionality in the
context of a basic two-tier application using simple Swing components to create a
generic RDBMS 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.
Search WWH ::




Custom Search