Take a SQL connection, pass it to a closure and ensure that the connection is closed after the closure returns, either normally or by an exception.
Take a SQL connection, pass it to a closure and ensure that the connection is closed after the closure returns, either normally or by an exception. If the closure returns normally, return its result.
a SQL connection
a Function1[Connection,R] that operates on the connection
the result of f
Take a SQL result set, pass it to a closure and ensure that the result set is closed after the closure returns, either normally or by an exception.
Take a SQL result set, pass it to a closure and ensure that the result set is closed after the closure returns, either normally or by an exception. If the closure returns normally, return its result.
a SQL result set
a Function1[ResultSet,R] that operates on the result set
the result of f
Take a SQL statement, pass it to a closure and ensure that the statement is closed after the closure returns, either normally or by an exception.
Take a SQL statement, pass it to a closure and ensure that the statement is closed after the closure returns, either normally or by an exception. If the closure returns normally, return its result.
a SQL statement
a Function1[Statement,R] that operates on the statement
the result of f
Utility object that contains functions that ensure a resource is released once it has been used. Each function takes resource object that has a method to release the resource, such as close(), and a closure to that operates on the resource. After the closure has completed, either normally via a return or by throwing an exception, the resource is released.