Class RDBConnectionHandler
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.rdb.RDBConnectionHandler
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class RDBConnectionHandler extends java.lang.Object implements java.io.CloseableUtility functions for connection handling.
-
-
Constructor Summary
Constructors Constructor Description RDBConnectionHandler(@NotNull javax.sql.DataSource ds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcloseConnection(java.sql.Connection c)Close theConnection.@NotNull java.sql.ConnectiongetROConnection()Obtain aConnectionsuitable for read-only operations.@NotNull java.sql.ConnectiongetRWConnection()Obtain aConnectionsuitable for read-write operations.@Nullable java.lang.StringgetSchema(java.sql.Connection c)Return current schema name ornullwhen unavailablebooleanisClosed()voidrollbackConnection(@Nullable java.sql.Connection c)Roll back theConnection.
-
-
-
Method Detail
-
getROConnection
@NotNull public @NotNull java.sql.Connection getROConnection() throws java.sql.SQLExceptionObtain aConnectionsuitable for read-only operations.- Throws:
java.sql.SQLException
-
getRWConnection
@NotNull public @NotNull java.sql.Connection getRWConnection() throws java.sql.SQLExceptionObtain aConnectionsuitable for read-write operations.- Throws:
java.sql.SQLException
-
rollbackConnection
public void rollbackConnection(@Nullable @Nullable java.sql.Connection c)Roll back theConnection.
-
closeConnection
public void closeConnection(java.sql.Connection c)
Close theConnection.
-
getSchema
@Nullable public @Nullable java.lang.String getSchema(java.sql.Connection c)
Return current schema name ornullwhen unavailable
-
isClosed
public boolean isClosed()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-