![]() |
|||
![]() ![]() |
![]() |
![]()
|
![]() |
Another approach is the three-tier architecture, which is discussed in greater detail later. While some of its benefits were already explained, this approach solves what might be the applets biggest problem. Eventually, the applet makes a connection to the third tier and requests or calls an action on a particular object. This request should trigger a conversation between the third tier and the database management system. In this case, connection information like database identification may be excluded from the applets code. Figure 4-5 depicts such a three-tiered architecture.
Java stand-alone applications are suitable within intranets and are deployable to specific users across the Internet, provided those users have access to some kind of parallel file transfer program. These applications run trusted code, are allowed to access the local file system, and open network connections to arbitrary hosts, just as normal applications do. Figure 4-6 represents the parts of a stand-alone application.
ODBC Versus Specific Drivers as SubprotocolODBC is available on a wide variety of platforms, including Windows, Unix, and Macintosh environments. This wide use is not enough to make a Java-based project totally portable, but it is sufficient in many cases. Using an ODBC leads to the same problem of deploying a non-Java underlying layer. It is very difficult to use such solutions on devices such as pure Network Terminals, but you may consider using an ODBC bridge or a native driver during development tests or within an environment known to be stable or not meant to evolve. The reasons such solutions are difficult to use are:
On the other hand, a full Java native-protocol driver, eventually using a third tier that does most of the job, offers these benefits:
SummaryThis chapter discussed the mechanisms used by JDBC, its programming interfaces, and some typical uses of JDBC. The next chapter explains how to program with JDBC.
|
![]() |
|