It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes jdbc architechture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jdbc architechture" Watch "jdbc architechture" New topic

jdbc architechture

swapna jhanjhar

Joined: Oct 03, 2010
Posts: 8
Hi all,
I've attached the architecture of my project.
If I follow this arch, then each time i have have to connect to db and fetch a record which increases db hit count.
for eample i've to populate 3 dropdowns on page load from one table. But i've to select only the dsitinct values from db. for this i've to use 3 queries which selects from that column distinct values. Since there are 3 queries, as per my proj architechture i've to connect to db thrice.

This actually reducing my project's performance. Can someone please suggest me a suitable architechture which will reduce the db hit count.??
Please help...

[Thumbnail for arch.JPG]

Tom Reilly

Joined: Jun 01, 2010
Posts: 618
This actually reducing my project's performance
Does this mean that you have more than a blurry picture? It would be a great help if you could post code. If you do not have code yet, I personally would continue with your current plans and only optimize after you have a demonstrable problem.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45277
Tom Reilly wrote: . . . Does this mean that you have more than a blurry picture? . . .
That picture tells us nothing useful, I am afraid.
Goutham Pallipati

Joined: Aug 13, 2008
Posts: 20
I could interpret few things from pic but not sure if they are correct.

Here is my understanding.
You call servlet from jsp.
Then a Standard DAO class is called from Servlet.

Just few Hints:
Normally establishing the Database connection takes time, hence you can implement connection pooling and then access the connection in DAO.
Avoid singleton pattern for DAO.
Also use PreparedStatements if the queries are not adhoc.
Remember most of the times badly written queries cause more performance issues. Try tuning Queries by indexing and other methods.

I agree. Here's the link:
subject: jdbc architechture
It's not a secret anymore!