If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

The variable dependantID is part of the resultSet of a previous SQL statement.
Can anyone suggest how to solve this problem? I have already tried to run the query as:
"select employeeID, dependantID FROM dependant where dependantID = "+rs.getInt("dependantID") +";";
But I got the same error message.

Just an idea..

Are you using two resultsets at the same time ? If I try that it fails; the first
resultset is being closed when the other resultset is being retrieved.
The only way I get around that is to use two different java.sql.Statement
objects, one for each of the two queries.

I would be better of you posted the code that fails, and the exception
you get. The snippet you have posted here doesn't tell the whole story.

It the problem is what I am thinking than its very funny. Neverthless its the most commonly made mistake.

1) Before retriving any data from the resultset do res.next() as pointer is placed at -1
2) Do not print res by itself but get the data as res.getInt( 1 ). if you know the column name than do res.getInt( "colname" );

if she is using sockets, wouldn't she be getting an exception because ResultSet does not implement the Serializable Interface. We can not send a ResultSet object through a socket ( as far as i know ) ???