No, ResultSet should not be exposed to more than one thread.
A ResultSet should never have a scope larger than a single method: execute the query, map the ResultSet into an object or collection, and close the ResultSet in the same scope in which it was created.
The correct way to close a ResultSet is in a finally block in its own try/catch.
Looked at the code in your other question. It needs a serious, complete refactoring. It's not surprising that you're having problems with it. Here are a few suggestions:
- Follow the Sun Java coding conventions. It might seem trivial, but anything that makes your code harder to read is a bad idea. Your "doComms" and "savetodatabase" classes break the "class names start with a capital letter" convention.
- Naming matters. "doComms" is not my idea of a good abstraction.
- Magic numbers/constants are everywhere. They'll make your code harder to change later.
- Java's an object-oriented language; you're writing in another style altogether. When I see "insert studentinfo", it makes me wonder where the Student class is.
- Your JDBC code doesn't handle resources properly at all.
Just curious - are you trying to learn how to write a server? Is there a reason why you wouldn't use a servlet engine as the basis for this app? Sockets are a very low level place to start to solve a problem like this.