Methods to get single and multiple JDBC results
You can factor out the boilerplate like so:

protected String getSingleFilePathResult(Query query) throws UwsException {
    return doWithConnection(conn -&gt; conn.getSingleFilePathResult(query));
}

protected List&lt;String&gt; getMultipleFilePathResults(Query query) throws UwsException {
    return doWithConnection(conn -&gt; conn.getMultipleFilePathResults(query));
}


protected &lt;T&gt; T doWithConnection(Function&lt;conn, T&gt; callback) throws UwsException {
    try (JdbcPooledConnection conn = createConnection()){
        return callback.Invoke(conn);
    } catch (SQLException sqle) {
        throw new UwsException(SQL_EXCEPTION + sqle.getMessage(), sqle);
    }
}