public class RDBConnectionHandler extends Object implements Closeable
| Constructor and Description |
|---|
RDBConnectionHandler(@NotNull DataSource ds) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
closeConnection(Connection c)
Close the
Connection. |
@NotNull Connection |
getROConnection()
Obtain a
Connection suitable for read-only operations. |
@NotNull Connection |
getRWConnection()
Obtain a
Connection suitable for read-write operations. |
@Nullable String |
getSchema(Connection c)
Return current schema name or
null when unavailable |
boolean |
isClosed() |
void |
rollbackConnection(@Nullable Connection c)
Roll back the
Connection. |
public RDBConnectionHandler(@NotNull
@NotNull DataSource ds)
@NotNull public @NotNull Connection getROConnection() throws SQLException
Connection suitable for read-only operations.SQLException@NotNull public @NotNull Connection getRWConnection() throws SQLException
Connection suitable for read-write operations.SQLExceptionpublic void rollbackConnection(@Nullable
@Nullable Connection c)
Connection.public void closeConnection(Connection c)
Connection.@Nullable public @Nullable String getSchema(Connection c)
null when unavailablepublic boolean isClosed()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.