This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC only application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC only application" Watch "JDBC only application" New topic
Author

JDBC only application

Leonardo Luiz
Ranch Hand

Joined: Mar 24, 2006
Posts: 51
Hi everyone,

I need to create an application using JSP, Servlets, and JDBC.
No EJB. No Hibernate. No Spring. I would like to see a reference application to help me doing this app. May be an open source project or a good tutorial.

I need to known the better aproach to do tasks like transaction handling, logging, etc. This application need to be 24x7 and support many simultaneus users.

Thanks in advance.

Leonardo Luiz
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41182
    
  45
I need to known the better aproach

Compared to what? It's not aproblem to develop a web app using just JSP, Servlets, and JDBC, with no EJB, no Hibernate and no Spring. You need to tell us what your baseline is right now that you are trying to improve upon.


Ping & DNS - my free Android networking tools app
Leonardo Luiz
Ranch Hand

Joined: Mar 24, 2006
Posts: 51
First of all thank you!

My baseline is made upon some examples from books and web tutorials.
I would like to see a working code written that way.
There are some best practices?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41182
    
  45
The good thing about best practices is that there are so many to choose from. You might start by reading these articles, which I found by googling "servlet|jsp|jdbc best practices":

http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index1.html

http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index2.html

http://java.sun.com/developer/technicalArticles/javaserverpages/servlets_jsp/

http://www.javaworld.com/javaworld/jw-11-2001/jw-1130-jsp.html

http://www.javaworld.com/javaworld/jw-07-2003/jw-0725-morejsp.html

http://jdj.sys-con.com/read/46653.htm

http://www.old.netobjectdays.org/pdf/02/papers/ws-jada/1149.pdf
[ March 20, 2007: Message edited by: Ulf Dittmer ]
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Leonardo,

Did somebody tell you: "you are not allowed to use Spring"?

It makes using JDBC a lot easier (you will end up with less code and better code):
-you can define transactions, Spring makes and closes connections for you,
-you can define 'interceptors' for logging

Herman
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41182
    
  45
I think it's good to start out without any web or database frameworks in order to learn what the underlying libraries can and can not do. Once those have been mastered one can add to the toolset, e.g. by using Hibernate for persistence, or something like Stripes or Struts for the web tier.
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Ulf,

I agree with you about the 'starting out', but
"This application need to be 24x7 and support many simultaneus users" does not sound like 'starting out' to me.

Herman
Leonardo Luiz
Ranch Hand

Joined: Mar 24, 2006
Posts: 51
Hi, thanks for yours answers!

The project's aim is to re-write an existing web application that actually makes use of these frameworks. The custumer doesn't want to search a framework specialist always a problem occurs.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Hmm. If I were given this task, I'd question the customer's justification for not using an existing framework. Given the limited non-functional requirements you mention my first move would be to look at existing "enterprise" frameworks, such as EJB or Spring. If these didn't exist, I be writing some sort of bespoke approximation of them myself.

Given that, I'm not sure I understand the limitation: how is it easier in terms of maintenance if you have designed from the ground up some sort of bespoke application, the architecture of which is understood only by you, rather than reusing an existing standard (or commonly used framework) that is understood by many people?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JDBC only application
 
Similar Threads
Replace JDBC calls with webservices
Plz help me ...Its very urgent
DSN on one terminal and JDBC connection on another terminal, how to connect?
does it still use servlets?
JDBC Connection Pooling Framework