aspose file tools*
The moose likes JDBC and the fly likes 3 tier design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "3 tier design" Watch "3 tier design" New topic
Author

3 tier design

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Could someone please provide some links/resources on creating a 3 teir database system using JAVA. I have gone through Sun's tutorials and bought a book on JDBC that had some examples but I haven't found anything that goes step by step.
Thanks for any help.


GenRocket - A Test Data Generation Platform
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 565
By "3-tier database system", don't you mean a 3-tier architecture? A database is usually the bottom tier in the architecture. Business logic is the middle tier and presentation stuff is the 3rd tier. Is this client-server or web-based? In client-server the presentation stuff goes on the client, in web-based apps, the presentation stuff happens in the browser but is created on the web server, kind of 3.5 tier.
The business logic can go on its own, or on the web server machine, or on the server with the database. You could actually have it spread across many machines as with web-farms, which is n-tier, and the database can also be replicated and be on several machines.
You'd probably be better off moving your post to one of the design or EJB forums.


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
actually, it is pretty easy....
i dont know any resources but ill try to explain it :
all you need to do is to create a class, lets call it Entity who is responsible for dealing with the database. this class will have a method for connecting to the database, for asking queires and for making statements.
then all you need to do from the client program to connect to database it make object of that class and invoke its methods. the main idea is that now the client doesnt have to use any SQL statments, he just calls for example:
entity.insert("helo") and the method does everything else.

hope it makes sense.
[ May 08, 2002: Message edited by: Roy Ben Ami ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Thanks for the replies guys. And if this post needs to be moved, please move it.
I guess what I would like to know are API's in which I should be learning to do this effectively. I would like my design to be web based. I already know JDBC like the back of my hand. Should I be looking at Servlets, RMI, etc? And if anyone knows of a good book or resource of some sort that kind of takes you through the process of setting each component up, that would be great.
Thanks again.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Gregg
For a multi tier web based app you're probabl looking at: JDBC, servlets, JSP, and, of course, HTML. Also, possably, JavaBeans too.
the HTML/JSP would be your front end/presentation layer while the servlets and beans would be your middle layer that use JDBC to connect to a DB (the third layer).
A couple of references to get you started:
JSP
Servlets
It is usually recommended to learn servlets first. I know I've seen a pretty good tutorial that explains the whole multi-tier thing too, I'll put it up as soon as I find it.


Dave
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Thanks Dave!
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Gregg
Here it is:
The J2EE tutorial has a good section on multi tiered apps. I think it focuses on distributed apps but should still give you a good idea of what you need.
If you're not using anything other than one server then you won't need remote objects or RMI.
hope that helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 3 tier design
 
Similar Threads
How the three step of SCEA work?
Multiple instance of Tomcat4.0.1
SessionBean TimeoutException
how to control high anger
increment/decrement