title: resultSet.next() returns false, even though table is populated
body: <p>I have a few functions that help with retrieving the objects from the database.</p>
  
  <pre><code>public User getUser(int beamID) throws NoSuchUserException {
      return userFromResultSet(getUserResultSet(beamID));
  }
  
  
  private ResultSet getUserResultSet(int beamID) {
      try(Connection conn = dataSource.getConnection()) {
  
          // queries.getUserByBeamID() returns "SELECT * FROM user WHERE beamID=?"
          PreparedStatement stmt = conn.prepareStatement(queries.getUserByBeamID());
  
          stmt.setInt(1, beamID);
          System.out.println(stmt.toString());
          return stmt.executeQuery();
  
      } catch (SQLException e) {
          e.printStackTrace();
          throw new IllegalStateException();
      }
  }
  
  private User userFromResultSet(ResultSet resultSet) {
      try {
          boolean next = resultSet.next();  // Debugger tells me this is false.
          if (!next)
              throw new NoSuchUserException();
  
          User user = new User(this,
               resultSet.getInt("beamID"),
               resultSet.getString("name"),
               resultSet.getInt("points"),
               resultSet.getInt("time")
          );
  
          if (resultSet.next())
              throw new IllegalStateException("Duplicate user entries exist - database integrity compromised!");
  
          return user;
      } catch (SQLException e) {
          e.printStackTrace();
          throw new IllegalStateException();
      }
  }
  </code></pre>
  
  <p>The strange thing is, I know the data <em>does</em> exist for two reasons:</p>
  
  <ul>
  <li><p>My program tries to create the entry if it does not exist, <strong>but attempting that gives an error that the unique constraint isn't being followed</strong>.</p></li>
  <li><p>Running the query in my SQLite DB browser works just fine:</p></li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/BorP5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/BorP5.png" alt="The query returns a result, as it should."></a></p>
  
  <p>I highly doubt that this is an issue with uncommitted data, as this is a file-based database, and opening that file with a text editor shows instances of the usernames in the data.</p>