• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc architechture

 
swapna jhanjhar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
arch.JPG
[Thumbnail for arch.JPG]
architechture
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 50171
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic