Invokes a closure passing it a new Sql instance created from the given JDBC connection URL. The created connection will be closed if required. @param url a database url of the form jdbc: subprotocol : subname @param c the Closure to call @see #newInstance(Stri
(String url, @ClosureParams(value=SimpleType.class, options="groovy.sql.Sql") Closure c)
| 334 | * @throws SQLException if a database access error occurs |
| 335 | */ |
| 336 | public static void withInstance(String url, @ClosureParams(value=SimpleType.class, options="groovy.sql.Sql") Closure c) throws SQLException { |
| 337 | try (Sql sql = newInstance(url)) { |
| 338 | c.call(sql); |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | /** |
| 343 | * Creates a new Sql instance given a JDBC connection URL |
nothing calls this directly
no test coverage detected