title: How to run several select queries with same statement and result set?
body: <p>I am trying to write simple Java web application to get data from a database.
  I need to run several select queries on different database tables. </p>
  
  <pre><code>String queryOne = "select firstname from employees where empid = id";
  String queryOne = "select title from books where bookid = bid";
  String queryOne = "select auther from books where bookid = bid";
  </code></pre>
  
  <p>And I tried to do it like this:</p>
  
  <pre><code>Connection connection = dataSource.getConnection();
  Statement statement = connection.createStatement();
  ResultSet rs1 = statement.executeQuery(queryOne);
  
  while (rs1.nest()) {
  String firstName = rs1.getString(1);
  }
  statement.close();
  connection.close();
  </code></pre>
  
  <p>I can only run one query with the same statement. How can I execute several queries with the same statement?</p>