@Override
    public void query(IAsyncResultHandler<IJdbcResultSet> handler, String sql, Object... params) {
        try(PreparedStatement statement = connection.prepareStatement(sql)) {
            int idx = 1;
            for (Object param : params) {
                statement.setObject(idx++, param);
            }
            ResultSet resultSet = statement.executeQuery();
            IJdbcResultSet rval = new DefaultJdbcResultSet(resultSet);
            handler.handle(AsyncResultImpl.create(rval));
        } catch (Exception e) {
            handler.handle(AsyncResultImpl.create(e, IJdbcResultSet.class));
        }
    }
@see io.apiman.gateway.engine.components.jdbc.IJdbcConnection#query(io.apiman.gateway.engine.async.IAsyncResultHandler, java.lang.String, java.lang.Object[])
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultJdbcConnection.java