Package org.apache.ignite.jdbc
Interface IgniteJdbcConnection
- All Superinterfaces:
AutoCloseable,Connection,Wrapper
Extension of the
Connection interface that exposes Ignite-specific configuration options.
Use Wrapper.unwrap(Class) to obtain an instance of this interface from a standard Connection:
Connection conn = ...
conn.unwrap(IgniteJdbcConnection.class)
.setTransactionTimeout(5000L);
-
Field Summary
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the transaction timeout, in milliseconds, applied to transactions started on this connection.@Nullable BooleanReturns whether read-only SQL statements executed on this connection may read data from non-primary replicas.voidsetAllowFollowerReads(@Nullable Boolean allowFollowerReads) Sets whether read-only SQL statements executed on this connection may read data from non-primary replicas.voidsetTransactionTimeout(@Nullable Long timeout) Sets the transaction timeout, in milliseconds, for transactions started on this connection.Methods inherited from interface java.sql.Connection
abort, beginRequest, clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, endRequest, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid, setTransactionIsolation, setTypeMapMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Method Details
-
getTransactionTimeout
Returns the transaction timeout, in milliseconds, applied to transactions started on this connection.- Returns:
- Transaction timeout in milliseconds, or
0if the cluster-wide default is used. - Throws:
SQLException
-
setTransactionTimeout
Sets the transaction timeout, in milliseconds, for transactions started on this connection. Overrides the value supplied via thetransactionTimeoutMillisconnection property. The new value applies to transactions started after this call; transactions already in progress are not affected.- Parameters:
timeout- Transaction timeout in milliseconds, ornull(or0) to use the cluster-wide default.- Throws:
SQLException- On error.
-
isAllowFollowerReads
Returns whether read-only SQL statements executed on this connection may read data from non-primary replicas.- Returns:
Trueif read from non-primary replicas is allowed for the connection,falseif disallowed,nullif the cluster-wide setting is used (default behavior).- Throws:
SQLException- On error.
-
setAllowFollowerReads
Sets whether read-only SQL statements executed on this connection may read data from non-primary replicas.- Parameters:
allowFollowerReads-Trueto allow read from non-primary replicas for the connection,falseto disallow,nullto use the cluster-wide setting (default behavior).- Throws:
SQLException- On error.
-