Download the JDK Search the Tutorials Hide the TOC
Trail: JDBC(TM) Database Access Lesson: JDBC Introduction
JDBC Introduction
JDBC Architecture
A Relational Database Overview
Home Page > JDBC(TM) Database Access > JDBC Introduction
« Previous • Trail • Next »
JDBC Architecture
P {
MARGIN-LEFT: 0pt; 0pt:
}
LI {
MARGIN-LEFT: 0pt; 0pt:
}
PRE {
MARGIN-LEFT: 24pt
}
LI {
MARGIN-LEFT: 0pt
}
OL LI LI {
MARGIN-LEFT: -2pt
}
UL LI LI {
MARGIN-LEFT: -2pt
}
H2 {
MARGIN-TOP: 56pt; FONT-WEIGHT: bold; FONT-SIZE: 18pt; MARGIN-BOTTOM: 40pt; MARGIN-LEFT: 3pt; COLOR: #e76e00; FONT-FAMILY: Sans-serif
}
H3 {
MARGIN-TOP: 36pt; FONT-SIZE: 16pt; MARGIN-BOTTOM: 24pt; MARGIN-LEFT: 3pt; COLOR: #e76e00; FONT-FAMILY: Sans-serif
}
H4 {
MARGIN-TOP: 24pt; FONT-SIZE: 12pt; MARGIN-BOTTOM: 18pt; MARGIN-LEFT: 0pt; COLOR: #e76e00; FONT-FAMILY: Sans-serif
}
TABLE {
MARGIN-LEFT: 24pt
}
TD {
TEXT-ALIGN: center
}
.center {
FONT-WEIGHT: bold; FONT-STYLE: italic; TEXT-ALIGN: center
}
.sql {
FONT-WEIGHT: bold; COLOR: #35556b; FONT-FAMILY: courier
}
JDBC Architecture
-->
The JDBC API supports both two-tier and three-tier processing models for database access.
Figure 1: Two-tier Architecture for Data Access.
In the two-tier model, a Java application talks directly to the data source. This requires a JDBC driver that can communicate with the particular data source being accessed. A user's commands are delivered to the database or other data source, and the results of those statements are sent back to the user. The data source may be located on another machine to which the user is connected via a network. This is referred to as a client/server configuration, with the user's machine as the client, and the machine housing the data source as the server. The network can be an intranet, which, for example, connects employees within a corporation, or it can be the Internet.
In the three-tier model, commands are sent to a "middle tier" of services, which then sends the commands to the data source. The data source processes the commands and sends the results back to the middle tier, which then sends them to the user. 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. Another advantage is that it simplifies the deployment of applications. Finally, in many cases, the three-tier architecture can provide performance advantages.
Figure 2: Three-tier Architecture for Data Access.
Until recently, the middle tier has often 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 and technologies such as Enterprise JavaBeans™, the Java platform is fast becoming the standard platform for middle-tier development. This is a big plus, making it possible to take advantage of Java's robustness, multithreading, and security features.
With enterprises increasingly using the Java programming language for writing server code, the JDBC API is being used more and more in the middle tier of a three-tier architecture. Some of the features that make JDBC a server technology are its support for connection pooling, distributed transactions, and disconnected rowsets. The JDBC API is also what allows access to a data source from a Java middle tier.
« Previous • Trail • Next »
Problems with the examples? Try Compiling and Running the Examples: FAQs. Complaints? Compliments? Suggestions? Give us your feedback.
Your use of this page (http://java.sun.com/docs/books/tutorial (Last Updated 2/14/2008)) and all the material on pages under "The Java Tutorials" banner is subject to the Terms of Use. Additionally, (i) any example code contained in any of these Java Tutorials pages is also licensed under the Code Sample License, and (ii) the entire Java Tutorials content is available for download under the Java Tutorials Limited Non-Commercial License for limited, non-commercial individual and/or research and instructional use at Sun Download Center.
About Sun About This Site Terms of Use Trademarks
A Sun Developer Network SiteCopyright 1995-2008 Sun Microsystems, Inc.
Previous page: JDBC Introduction Next page: A Relational Database Overview
Friday, July 18, 2008
Subscribe to:
Posts (Atom)