Question: Is it bad habit to use the same `ResultSet` object in Java? Why or why not? //It seems to be my only option here, as I am trying to query a table for its record count, and then query a view of that table; I don't know how to change the view.

In other words, is 

```
ResultSet myResultSet = statement.executeQuery("SELECT count(*) FROM table");
myResultSet.next();
int recordCount = myResultSet.getInt(1);
myResultSet = statement.executeQuery("SELECT * FROM tableView");
//set other variables based on contents of fetched view

```

a bad idea?

Answer: 
The code you have posted does not "reuse the same `ResultSet`", it simply discards one `ResultSet` object and then uses the same variable to hold a reference to a different `ResultSet` created by the second `executeQuery`. It would be good coding practice to call `close()` on the first result set before you overwrite the reference with the second one, but this is not strictly necessary because

> 
> A `ResultSet` object is automatically closed when the `Statement` object that generated it is closed, **re-executed**, or used to retrieve the next result from a sequence of multiple results.
> 
> 
> 

(from the [ResultSet JavaDoc documentation](http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html), my bold)
Once you are done with the table, you can close the respective result set. And the same reference can be used for another table.

If you want to query table and view simultaneously then you will require two separate result sets.