spring-framework / org.springframework.jdbc.datasource / LazyConnectionDataSourceProxy / getConnection

getConnection

open fun getConnection(): Connection

Return a Connection handle that lazily fetches an actual JDBC Connection when asked for a Statement (or PreparedStatement or CallableStatement).

The returned Connection handle implements the ConnectionProxy interface, allowing to retrieve the underlying target Connection.

Return
a lazy Connection handle

See Also
ConnectionProxy#getTargetConnection()

open fun getConnection(username: String, password: String): Connection

Return a Connection handle that lazily fetches an actual JDBC Connection when asked for a Statement (or PreparedStatement or CallableStatement).

The returned Connection handle implements the ConnectionProxy interface, allowing to retrieve the underlying target Connection.

Parameters

username - the per-Connection username

password - the per-Connection password

Return
a lazy Connection handle

See Also
ConnectionProxy#getTargetConnection()