If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > ConnectException after reopening Connection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-12-03, 11:16
mahjong mahjong is offline
Registered User
 
Join Date: Nov 2003
Posts: 3
Unhappy ConnectException after reopening Connection

Hi,

I have my own database connection pool manager written in Java. It works just fine under normal conditions. But when there are
idle perioids for the system, the pooled Connectins become
idle too and Connections start to drop down.
I can detect that in my code, but when I try to create new Connection to the database bad things start to happen.

Connection con = DriverManager.getConnection(URL, user, password);

it throws:

UNABLE TO CREATE CONNECTION: java.sql.SQLException:Unable to connect to any hosts due to exception:java.net.ConnectException: Connection timed out: connect


Then I manually tried to select stuff from the tables, MySQL prompted:

ERROR 2013: Lost connection to MySQL server during query...ERROR 2006:MySQL server has gone awayNo connection. Trying to reconnect...Connection id: 267Current database: log


Why I can`t create any new Connection and why the MySQL reports those errors? Is there something going on with the DriverManager !?

Your advice appreciated!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On