• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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..
 
reply
    Bookmark Topic Watch Topic
  • New Topic