• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

ServletContextListener

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all...

1. I writen a code for access database connection through contextlistener,




2. Attribute class


How can i achieve the availabelity of database connection for the entier application....
if i write a servlet class for access data items from tabel, their also i need connection object, statement object and more as same like Attribute class( which shown above 2).

please any one can help me how can i write a code in servlet for access a database items.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by lokesh rajarathnam:

How can i achieve the availabelity of database connection for the entier application....



You shouldn't.
Instead look into connection pooling.
All modern, spec compliant servers offer it at a container level.

What you're trying to do will give you nothing but headaches and will most likely result in a slow application.
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:

What you're trying to do will give you nothing but headaches and will most likely result in a slow application.



you know Lokesh That's completely true, it does cause headaches,,
I'm still suffering of using that way..
 
You didn't tell me he was so big. Unlike this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic