The start of the transaction was not in a try with resource block, so in case of exception the connection was not cleanly rolled back and closed.
Deprecated method calls have been replaced by non deprecated methods.
The call to setParameter with 3 parameters has been replaced by the one with 2 parameters (as the implicit Conversion false is the default value of ServerConfig).