• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

database access & request dipatcher

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
1) How to handle multiple concurrent database requests/updates when using JDBC with servlets?
2)When using a dispatcher and calling .forward(), will doGet() or doPost() be called in the target servlet?

Rgrds
 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys
Can anyone take a shot at this
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Firstly these are two questions, it would be better to hava separate thread for each.
Database access in a J2EE application should be managed through a DataSource configured in the application server. This allows the server to manage distributed transactions (if the database and drivers support this). It makes database access much easier since you can go (pseudo code only ):

It is important to note that the database code does not have to be in the Servlet (you can delegate the responisility to another class that just returns objects).
I'll have to check on the other, I only ever forward to a JSP, and the _jspService takes care of both. I believe it will be whatever the initial request was ie GET -> forward -> doGet, POST -> forward -> doPost, but I'll have to double check.
Dave
 
There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic