getConnection

override fun getConnection(): Connection

It is best to use this function within a try-with-resource construct This method calls the DataSource for a connection from the underlying DataSource. You are responsible for closing the connection.

getConnection().use { con ->

}

Return

a connection to the database

Throws

SQLException

if there is a problem with the connection