This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC only application

 
Leonardo Luiz
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Leonardo Luiz
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic