Sql Exception

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • haran22
    New Member
    • May 2007
    • 11

    Sql Exception

    how to overcome from the exception java.sql.SQL.Ex ception: [My Sql)[ODBC 3.51 Driver] Too many connections
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by haran22
    how to overcome from the exception java.sql.SQL.Ex ception: [My Sql)[ODBC 3.51 Driver] Too many connections
    Database connections are expensive things: i.e. they take quite some time to
    create and they take quite a lot of resources. Databases can only handle a
    limited amount of connections.

    When you're done using a connection you're supposed to close the connection
    in order to relinguish all those database resources. You didn't do that and so
    the database started complaining.

    You could either try to manage those connections yourself or you could use
    one of the many available ConnectionPools ; they all apply their own strategy
    how and when a connection should be closed or not.

    Have a look at http://www.apache.org, they have very fine ConnectionPools
    available in their 'commons' sub project.

    kind regards,

    Jos

    Comment

    Working...