3 Tier Database Access in Java

From: gcomeau@gcomeau.com (Gregory Comeau) Date: Sun, 23 Feb 1997 13:33:07 GMT On Sat, 22 Feb 1997 13:10:31 -0800, Steve Croft wrote:

Hey folks, JDBC is *not* a three-tier application architecture. I don't care how Symantec promotes it! In a three-tier application architecture you partition your application into three seperate tiers which can run on seperate machines: the presentation part, the application part, and the data part. The "database access libraries" Suneet Shah was referring to are the data methods the programmer (or DBA) builds for general access to the data and this executes from the application layer. Suneet is looking for tools to help build this layer.

Note that the use of the term "three-tier" has traditionally referred to an "application" architecture and not underlying connectivity architectures. The attempt by some vendors to imply that use of their multi-layer connectivity architecture magically partitions your application is misleading at best! Otherwise we could say we've been writing three tier apps for as long as DNS has been around (Gee, my app gets data from the DNS server which gets its data from another server, etc.).

Now as an example, I run an applet from my browser, it requests data from some object out on the network and those objects will retrieve the data from a remote database and then send the data back to the applet running in the browser. The applet, the data objects, and the database are executing from seperate machines. This application is considered three-tier because it is partitioned into three seperate layers at the application level, not because the app uses JDBC.

If your application is 3-tier the following condition, among others, must apply:

Your client tier must contain *no* SQL. That means the java.sql package is not even imported. If you change the database schema then you should only have to change the application layer, *not* the client layer.
If this condition isn't met then you might have a distributed 2-tier application, certainly not a 3-tier.