Refactored to use jOOQ SQL execution