Package org.apache.jena.jdbc.connections
Class DatasetConnection
java.lang.Object
org.apache.jena.jdbc.connections.JenaConnection
org.apache.jena.jdbc.connections.DatasetConnection
- All Implemented Interfaces:
AutoCloseable
,Connection
,Wrapper
- Direct Known Subclasses:
MemConnection
,TDBConnection
Represents a connection to a
Dataset
instance-
Field Summary
Fields inherited from class org.apache.jena.jdbc.connections.JenaConnection
DEFAULT_AUTO_COMMIT, DEFAULT_HOLDABILITY, DEFAULT_ISOLATION_LEVEL
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
Constructor Summary
ConstructorsConstructorDescriptionDatasetConnection
(Dataset ds, int holdability, boolean autoCommit, int transactionLevel, int compatibilityLevel) Creates a new dataset connection -
Method Summary
Modifier and TypeMethodDescriptionvoid
Begins a new transactionfinal Dataset
Gets the dataset to which this connection pertainsboolean
isClosed()
boolean
boolean
isValid
(int timeout) void
setReadOnly
(boolean readOnly) Methods inherited from class org.apache.jena.jdbc.connections.JenaConnection
abort, addPostProcessor, addPreProcessor, applyPostProcessors, applyPostProcessors, applyPostProcessors, applyPostProcessors, applyPostProcessors, applyPostProcessors, applyPreProcessors, applyPreProcessors, applyPreProcessors, clearPostProcessors, clearPreProcessors, clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getJdbcCompatibilityLevel, getMetaData, getNetworkTimeout, getPostProcessors, getPreProcessors, getSchema, getTransactionIsolation, getTypeMap, getWarnings, insertPostProcessor, insertPreProcessor, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, removePostProcessor, removePostProcessor, removePreProcessor, removePreProcessor, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setJdbcCompatibilityLevel, setNetworkTimeout, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, unwrap
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Constructor Details
-
DatasetConnection
public DatasetConnection(Dataset ds, int holdability, boolean autoCommit, int transactionLevel, int compatibilityLevel) throws SQLException Creates a new dataset connection- Parameters:
ds
- Datasetholdability
- Cursor holdabilityautoCommit
- Sets auto-commit behavior for the connectiontransactionLevel
- Sets transaction isolation level for the connectioncompatibilityLevel
- Sets JDBC compatibility level for the connection, seeJdbcCompatibility
- Throws:
SQLException
-
-
Method Details
-
getJenaDataset
Gets the dataset to which this connection pertains- Returns:
- Dataset
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceConnection
- Specified by:
isClosed
in classJenaConnection
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnly
in interfaceConnection
- Specified by:
isReadOnly
in classJenaConnection
-
isValid
public boolean isValid(int timeout) - Specified by:
isValid
in interfaceConnection
- Specified by:
isValid
in classJenaConnection
-
setReadOnly
- Specified by:
setReadOnly
in interfaceConnection
- Specified by:
setReadOnly
in classJenaConnection
- Throws:
SQLException
-
begin
Begins a new transactionTransactions are typically thread scoped and are shared by each thread so if there is an existing read transaction and another thread tries to start a read transaction it will join the existing read transaction. Trying to join a transaction not of the same type will produce an error.
- Parameters:
type
-- Throws:
SQLException
-