DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: creating a DB connection pool using ServletContext feature

  1. #1
    D Cayce Guest

    creating a DB connection pool using ServletContext feature


    James Goodwill in his "Developing Java Servlets" book talks about
    developing a pool of database connections to be managed by a Servlet and
    passing the Connection objects to other Servlets to be returned when they
    are no longer needed and placed back into the pool.

    This seemed like a good plan until I tried to us it. All seems to go well
    until I call the same servlet a second time. The HTML page that should be
    generated is displayed as blank. I have had this happen before with a incorrectly
    structured SQL query. Therefore, I assume, that the passed Connection object
    to the calling Servlet is somehow broken.

    Any suggestions?

  2. #2
    Jo Desmet Guest

    Re: creating a DB connection pool using ServletContext feature

    first of all, did you re-execute your query, maybe you are still working on
    the same result set?
    if you run through each row in the result set, the rowpointer points at the
    end be-on the last row, so when this is not reset for all subsequent calls
    to next() nothing will actually happen. next() will return false.
    Only a wild guess, some minimum code could help.


    "D Cayce" <dcc@bigrooster.com> wrote in message
    news:3987958c$1@news.devx.com...
    >
    > James Goodwill in his "Developing Java Servlets" book talks about
    > developing a pool of database connections to be managed by a Servlet and
    > passing the Connection objects to other Servlets to be returned when they
    > are no longer needed and placed back into the pool.
    >
    > This seemed like a good plan until I tried to us it. All seems to go well
    > until I call the same servlet a second time. The HTML page that should be
    > generated is displayed as blank. I have had this happen before with a

    incorrectly
    > structured SQL query. Therefore, I assume, that the passed Connection

    object
    > to the calling Servlet is somehow broken.
    >
    > Any suggestions?




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center