This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Communication Link Failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Communication Link Failure" Watch "Communication Link Failure" New topic
Author

Communication Link Failure

Ramesh Balakrishnan
Greenhorn

Joined: Mar 19, 2004
Posts: 4
Hello people,
We are developing a job search engine.We use JDBC concepts for getting stored data for the purpose of searching particular job title.We use multithread programming. In this we get "communication Link failure" when we declare prepared statement globally.But while declaring that statement in local method there will not be any error.
we want to know the reason for communication link failure.This may come under threading problems.we welcome your suggestions and solutions.
you can make visit to www.jobpier.com to know the searching details.This may be useful for job seekers also
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I'm assuming this error is related to the database you are using. Can you give us more details please?
Ramesh Balakrishnan
Greenhorn

Joined: Mar 19, 2004
Posts: 4
Hai David,
I am using mySQL 1.4.0 version for database accesssing.In our program we continously executing the query for all the page contents in our database.During the process the "Communication Link Failure" occurs.This when we use single thread also...
Dana Hanna
Ranch Hand

Joined: Feb 28, 2003
Posts: 227
Only use a PreparedStatement object from one thread at a time. Declare methods synchronized as needed - the resultset returned also needs to be part of the SAME synchronization. An application server with a good connection pooling and prepared statement caching would help you here. What are you using?
Ramesh Balakrishnan
Greenhorn

Joined: Mar 19, 2004
Posts: 4
Yah...That's fine.We made thread synchronization that a single should accesss the prepared statement and resultset.There is no exception...Thanks...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Communication Link Failure
 
Similar Threads
Graphic Design at Whoa Mama Design, in Chennai
IOException
Help! Getting IOException and Communication Link error with DB
Question about bug in JDK (SocketTimeoutException : Timing out early)
How to Handle this Exception