Class RDBConnectionHandler
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class RDBConnectionHandler extends Object implements Closeable
Utility functions for connection handling.
-
-
Constructor Summary
Constructors Constructor Description RDBConnectionHandler(@NotNull DataSource ds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
closeConnection(Connection c)
Close theConnection
.@NotNull Connection
getROConnection()
Obtain aConnection
suitable for read-only operations.@NotNull Connection
getRWConnection()
Obtain aConnection
suitable for read-write operations.@Nullable String
getSchema(Connection c)
Return current schema name ornull
when unavailableboolean
isClosed()
void
rollbackConnection(@Nullable Connection c)
Roll back theConnection
.
-
-
-
Constructor Detail
-
RDBConnectionHandler
public RDBConnectionHandler(@NotNull @NotNull DataSource ds)
-
-
Method Detail
-
getROConnection
@NotNull public @NotNull Connection getROConnection() throws SQLException
Obtain aConnection
suitable for read-only operations.- Throws:
SQLException
-
getRWConnection
@NotNull public @NotNull Connection getRWConnection() throws SQLException
Obtain aConnection
suitable for read-write operations.- Throws:
SQLException
-
rollbackConnection
public void rollbackConnection(@Nullable @Nullable Connection c)
Roll back theConnection
.
-
closeConnection
public void closeConnection(Connection c)
Close theConnection
.
-
getSchema
@Nullable public @Nullable String getSchema(Connection c)
Return current schema name ornull
when unavailable
-
isClosed
public boolean isClosed()
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-