Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting started

 
Amy Phillips
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I will soon be working on a databse application which will use servlets and maybe an applet interface. I have never used a databse with java before and was wondering if anyone could give me some tips for getting started.
What sort of issues do I need to address? - this is a student project so security will not be a huge issue but I guess there are basics I must look into?
Thanks
 
Andy Bowes
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amy
Probably one of the key issues, especially if you are proposing to have multiple User Interfaces, is to separate the database access code from the User Interface. The standard way to do this is to use a Design Pattern called Data Access Objects (DAO).
Paul Wheaton of Java Ranch has created a neat tool called Jenny which can automate the process of creating this database abstraction layer see Jenny FAQ
regards
 
Vamshi Krishna
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amy Phillips,
JDBC programming is quite easy. It always have a set of default steps to be followed to work with.
Please go through the link below to know about JDBC and also write the programs in JDBC:
http://java.sun.com/docs/books/tutorial/jdbc/basics/
 
Amy Phillips
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could I just ask you a few more questions...
Does the DAO replace the servlet layer or are these completly different things?
I will do some research into all of these things and hopfully the details will come together but if not I'll be posting here again!
Thanks to both of you I should hopefully be able to at least get started!
[ June 17, 2003: Message edited by: Amy Phillips ]
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amy,
Although I realize that what works for me may not work for you, I personally don't like to use a tool that automates a process, until I fully understand the process. So if, as you claim, you are new to JDBC, allow me to suggest starting with the basics (as Krishi has suggested) before progressing to the process automating tools.
The type of application you are describing is also known as an "enterprise application". The "Java 2 Enterprise Edition" (J2EE) is designed for developing such applications. In case you are unaware, you can find out more about J2EE from this Web site:
http://java.sun.com/j2ee
The "DAO" pattern that Andy is referring to is described in the "J2EE Blueprints" document, that is available from here:
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications/index.html
By the way, you don't really need to know about J2EE in order to develop your application.
Hope this has helped you.
Good Luck,
Avi.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amy Phillips:
Does the DAO replace the servlet layer or are these completly different things?

No, DAO doesn't replace the servlet layer. The servlet layer receives HTTP communication while the DAO framework gives your business logic layer access to the database.
A typical architecture in Java web applications is:
Client <-(http)-> Servlet <-> Business Logic <-> Data Access Objects <-> Database
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will soon be working on a databse application which will use servlets and maybe an applet interface. I have never used a databse with java before and was wondering if anyone could give me some tips for getting started.
Mosey on over to The JavaRanch Cattle Drive and check out the Servlets and JDBC assignments.
 
David Jordan
Author
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could consider JDO to be your Data Access Object layer. Then you just deal with defining your object model and let the JDO implementation do all the JDBC work for you. You will have an application up and running much faster with JDO than JDBC if you are new to JDBC and plan to use/develop a Data Access Object layer anyway...
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David Jordan:
You will have an application up and running much faster with JDO than JDBC if you are new to JDBC and plan to use/develop a Data Access Object layer anyway...

I'd like to add that in my opinion it's important to know the JDBC as well. You might begin with JDO and delve into JDBC then or you might begin by dipping your head into JDBC to get the basics correct, and then move to JDO which abstracts all the nasty SQL/JDBC from you.
In my experience, you always need to know to some extent who's doing what under the hood. Eventually.
 
Amy Phillips
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its for a university assignment so I think I will stick to getting the basic right and then learn the extras later on. I am on the cattledrive but haven't reached the Servlets or JDBC parts yet.
I have been to the barnhouse and will get a general book on these subjects and then come and bother you all when I try to get this implemented
Thanks for all the suggestions
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic