Results 1 to 3 of 3
  1. #1
    sandeepsai39 is offline Member
    Join Date
    Feb 2009
    Rep Power

    Default JDBC Connection Creation Problem.Help needed?

    Hi to all,

    Currently i am using connections which are created during web application loading and each and every time when i use connection related methods i am closing the connections.What my problem is
    i read that it is not efficient to close connection objects.Some of them suggested to use object pool design pattern,some thing like to have a ConnectonPool Concept where all connections are created.
    But the actual problem is after some time connection object is closed by default.I need some code where Connection Pool is maintained and if a connection is closed the connection object automatically created.

    Thanks Regarding
    Sandeep Reddy Mukkala

  2. #2
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Rep Power


    I am not an expert, actually I ask about connection pool here in this forum and they suggested me Apache DBCP but the documentation is quite not good so you might want to search for tutorials about that

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power


    Yep, use an existing connection pool mechanism (like DBCP).
    There are others, so have a hunt around.
    Writing your own is a pain, due in part to the need to write a keep-alive loop for the connections, and a way of repairing lost connections.

Similar Threads

  1. Replies: 0
    Last Post: 02-09-2011, 03:22 PM
  2. JDBC Connection problem.
    By chyrl in forum Advanced Java
    Replies: 14
    Last Post: 09-22-2010, 08:33 AM
  3. Jdbc problem.Help Needed
    By illusion1912 in forum New To Java
    Replies: 4
    Last Post: 01-09-2009, 06:35 AM
  4. Problem in jdbc connection with servlets
    By illusion1912 in forum Java Servlet
    Replies: 0
    Last Post: 01-06-2009, 07:34 PM
  5. jdbc connection problem
    By Assaf A in forum JDBC
    Replies: 0
    Last Post: 12-01-2008, 05:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts