code: public static ResultSet query(Connection connection, String sql,
  			String[] selectionArgs) {
  
  		PreparedStatement statement = null;
  		ResultSet resultSet = null;
  
  		try {
  			statement = connection.prepareStatement(sql);
  			setArguments(statement, selectionArgs);
  			resultSet = statement.executeQuery();
  		} catch (SQLException e) {
  			throw new GeoPackageException("Failed to execute SQL statement: "
  					+ sql, e);
  		} finally {
  			if (resultSet == null) {
  				closeStatement(statement, sql);
  			}
  		}
  
  		return resultSet;
  	}
docs: Query for results
  
  @param connection
  connection
  @param sql
  sql statement
  @param selectionArgs
  selection arguments
  @return result set