File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Communication Link Failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Communication Link Failure" Watch "Communication Link Failure" New topic

Communication Link Failure

Ramesh Balakrishnan

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 to know the searching details.This may be useful for job seekers also
David O'Meara

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

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

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...
I agree. Here's the link:
subject: Communication Link Failure
It's not a secret anymore!