wood burning stoves 2.0*
The moose likes JDBC and the fly likes com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: " Watch "com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: " New topic
Author

com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

vinoth Robert
Ranch Hand

Joined: Feb 02, 2011
Posts: 31

good noon...

i am using mysql database in my java application.
i've connected mysql stored and retrieved from database using my java program.

now my problem is i need to run a long process. that means 5 functions that is needed to run one by one (each function connects database do some work).
while doing this i am getting this exception

Unable to connect to database.com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: java.net.BindException: Address already in use: connect

STACKTRACE:

java.net.SocketException: java.net.BindException: Address already in use: connect
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:151)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1699)
at com.mysql.jdbc.Connection.<init>(Connection.java:405)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at mrf_general.DBConnection.getConnect(DBConnection.java:22)
at mrf_general.DataBase.update_SAPlog(DataBase.java:98)
at importSAP.ScheduleMyJob.updateStockInTransit(ScheduleMyJob.java:38)
at mrf_general.ScheduleMRF.RunSchedule(ScheduleMRF.java:30)
at Schedule.MrfSuserSchedule$1.startSchedule(MrfSuserSchedule.java:58)
at Schedule.MrfSuserSchedule$1.run(MrfSuserSchedule.java:51)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:54)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)


** END NESTED EXCEPTION **


I could not find why this exception occurs.

any one help me.....

vinoth.R
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: