title: Can PreparedStatement.addBatch() be used for SELECT queries?
body: <p>Imagine that I have 100 SELECT queries that differ by one input.  A PreparedStatement can be used for the value.</p>
  
  <p>All the documentation I see on the Web is for batch insert/update/delete.  I have never seen batches used for select statements.</p>
  
  <p>Can this be done?  If so, please help me when the below sample code.</p>
  
  <p>I suppose this can be done using an "IN" clause, but I would prefer to use batched select statements.</p>
  
  <p>Sample code:</p>
  
  <pre>
  public void run(Connection db_conn, List value_list) {
      String sql = "SELECT * FROM DATA_TABLE WHERE ATTR = ?";
      PreparedStatement pstmt = db_conn.prepareStatement(sql);
      for (String value: value_list) {
          pstmt.clearParameters();
          pstmt.setObject(1, value);
          pstmt.addBatch();
      }
      // What do I call here?
      int[] result_array = pstmt.executeBatch()
      while (pstmt.getMoreResults()) {
          ResultSet result_set = pstmt.getResultSet();
          // do work here
      }
  }
  </pre>
  
  <p>I suppose this may also be driver-dependent behaviour.  I am writing queries against IBM AS/400 DB2 database using their JDBC driver.</p>