Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

3 tier design

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dave!
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic