All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlin.jdbc.Statements.kt Maven / Gradle / Ivy

There is a newer version: 0.14.451
Show newest version
package kotlin.jdbc

/**
 * Helper method to process a statement on this collection
 */
import java.sql.Statement

/**
 * Uses the statement with the given block then closes the statement
 */
fun  S.useSql(block : (S) -> T) : T { // TODO rename to "use" when KT-2493 is fixed
    try {
        return block(this)
    } finally {
        close()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy