public class ProxyUtils extends Object
Connection from proxy class.| Modifier and Type | Method and Description |
|---|---|
static Optional<Connection> |
unwrapConnection(Batch batch)
Get original
Connection from proxy Batch. |
static Optional<Connection> |
unwrapConnection(Connection connection)
|
static Optional<Connection> |
unwrapConnection(Result result)
Get original
Connection from proxy Result. |
static Optional<Connection> |
unwrapConnection(Statement statement)
Get original
Connection from proxy Statement. |
public static Optional<Connection> unwrapConnection(Connection connection)
connection - a connectionIllegalArgumentException - if connection is nullpublic static Optional<Connection> unwrapConnection(Batch batch)
Connection from proxy Batch.
When provided Batch is a proxy that implements ConnectionHolder, retrieves original
Connection; otherwise, returns empty Optional.batch - a batchIllegalArgumentException - if batch is nullpublic static Optional<Connection> unwrapConnection(Statement statement)
Connection from proxy Statement.
When provided Statement is a proxy that implements ConnectionHolder, retrieves original
Connection; otherwise, returns empty Optional.statement - a statementIllegalArgumentException - if statement is nullpublic static Optional<Connection> unwrapConnection(Result result)
Connection from proxy Result.
When provided Result is a proxy that implements ConnectionHolder, retrieves original
Connection; otherwise, returns empty Optional.result - a statementIllegalArgumentException - if result is nullCopyright © 2020. All rights reserved.