How does a 3tier architecture work

There r three Layers:-

The GUI layer

The GUI is the "top layer".It contains all things that are visible to user, the 'outside' of the system, such as screen layout and navigation. The GUI layer has techniques like HTML, CSS, Applet, Servlet, JSP, JHTML.

The Object layer

This is the core of the system, the linking pin between the other layers. The object layer has knowledge, in two different ways: runtime values, like the custome
r name "Oxford & Associates" or the invoice number "OAA2000w36".Structural knowledge, about data and processing.

Data example

A customer can receive many invoices, and an invoice always goes to just one customer. Proces example :- Know who does what. Every objects knows his own methods, and those of his neighbours. In a pure OO model an object talks to his neighbours, and nobody but his neighbours. In the object layer you'll find things like Classes,objects, instance variables, vectors, primitives, methods, polymorphism, encapsulation and inheritance. The objects mostly have a temporary nature. They "live" just in memory for the duration of a transaction or session.

Database Layer

The database layer takes care of persistency. An object from the object layer can write itself to one or more tables. In the database layer you'll find things like database, connection, table, SQL and result set.