5 messages in com.mysql.lists.javaRE: A tricky problem regarding JDBC r...
FromSent OnAttachments
Jon Finanger04 Apr 2003 04:30 
Mark Matthews04 Apr 2003 04:33 
Jon Finanger04 Apr 2003 04:46 
Mark Matthews04 Apr 2003 05:34 
Shankar Unni04 Apr 2003 10:25 
Subject:RE: A tricky problem regarding JDBC reconnect
From:Jon Finanger (jfi@online.no)
Date:04/04/2003 04:46:07 AM
List:com.mysql.lists.java

wow! very fast answer :-) well, you mean that applications running on windows2000 never will be able to
retrieve from windows that a 'new' network interface is present? Thats really a drawback :(

-Jon

-----Original Message----- From: Mark Matthews [mailto:ma@mysql.com] Sent: 4. april 2003 14:34 To: jfi@online.no Cc: ja@lists.mysql.com Subject: Re: A tricky problem regarding JDBC reconnect

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Jon Finanger wrote: | Hi! | I've a little problem which I cant find a good solution to. | The scenario is as follows: | | If i connect to a mysql database on a given host, then disconnecting the network cable, and then reconnect the cable my 'reconnect' | logic handles that. BUT when i start java program without the cable (i naturally gets the java.net.UnknownHostException) and then | connect the cable to get on 'net' i'm NOT able to reconnect anymore. I still get this error: java.sql.SQLException: Cannot connect | to MySQL server on myhost2:3306. Is there a MySQL server running on the machine/port you are trying to connect to? | (java.net.UnknownHostException) | | To me it looks like the driver is not able to detect that the net is back so it can bind. would guess it only binds on localhost. | Even if i do this when an error occurs: DriverManager.deregisterDriver( | DriverManager.getDriver(prop.getProperty("url"))); | Driver d = (Driver) Class.forName(prop.getProperty("jdbc.drivers")).newInstance(); | DriverManager.registerDriver(d); | nothing happens. | | Any idea of what to do? Its quite likely that my java server will be without network when starting from time to time. (unless i run | mysql and the javaserver on localhost) | | running mysql classic 3.23.42 on win2000. jdbc driver: mysql-connector-java-2.0.14-bin.jar | | -Jon

The problem you are talking about is low-level...it has to do with the TCP/IP stack on Windows and how it interacts with Java...There is nothing the driver can do about it :(

-Mark

- -- MySQL 2003 Users Conference -> http://www.mysql.com/events/uc2003/

For technical support contracts, visit https://order.mysql.com/?ref=mmma

iD8DBQE+jXuitvXNTca6JD8RAs6LAKCfj5Af/yvAxpik9LDOfORrTqEbKQCgvYrA 2EiDOuAAPhCF/atE+PUfnhI= =9QHm -----END PGP SIGNATURE-----