Interface RelationalConnection
- All Superinterfaces:
AutoCloseable
,Connection
,Wrapper
A connection to a Relational database.
This functions very much like a Connection
, but contains some overloaded methods
to support RelationalStatement
.
-
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 TypeMethodDescriptiondefault void
default void
default Blob
default Clob
default ExpressionFactory
default NClob
default SQLXML
Create a RelationalStatement which can be executed using this DatabaseConnection.default Statement
createStatement
(int resultSetType, int resultSetConcurrency) default Statement
createStatement
(int resultSetType, int resultSetConcurrency, int resultSetHoldability) default StatementBuilderFactory
default String
default Properties
default String
getClientInfo
(String name) default int
default int
getPath()
default SQLWarning
default boolean
default boolean
isValid
(int timeout) default boolean
isWrapperFor
(Class<?> iface) default String
default CallableStatement
prepareCall
(String sql) default CallableStatement
prepareCall
(String sql, int resultSetType, int resultSetConcurrency) default CallableStatement
prepareCall
(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement
(String sql) Creates aRelationalPreparedStatement
object for sending parameterized SQL statements to the database.default PreparedStatement
prepareStatement
(String sql, int autoGeneratedKeys) default PreparedStatement
prepareStatement
(String sql, int[] columnIndexes) default PreparedStatement
prepareStatement
(String sql, int resultSetType, int resultSetConcurrency) default PreparedStatement
prepareStatement
(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) default PreparedStatement
prepareStatement
(String sql, String[] columnNames) default void
releaseSavepoint
(Savepoint savepoint) default void
default void
setCatalog
(String catalog) default void
setClientInfo
(String name, String value) default void
setClientInfo
(Properties properties) default void
setHoldability
(int holdability) default void
setNetworkTimeout
(Executor executor, int milliseconds) void
setOption
(Options.Name name, Object value) default void
setReadOnly
(boolean readOnly) default Savepoint
default Savepoint
setSavepoint
(String name) default void
setTypeMap
(Map<String, Class<?>> map) default <T> T
Methods inherited from interface java.sql.Connection
beginRequest, close, commit, createArrayOf, createStruct, endRequest, getAutoCommit, getMetaData, getSchema, getTransactionIsolation, isClosed, rollback, setAutoCommit, setSchema, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid, setTransactionIsolation
-
Method Details
-
createStatement
Create a RelationalStatement which can be executed using this DatabaseConnection. If this connection instance is closed, this RelationalStatement becomes invalid and should be discarded. Using a RelationalStatement object after it's backing Connection is closed is a programmer error. Note that this override specializes the createStatement return to make it a RelationalStatement rather than a plain JDBC Statement. This change is non-additive as are the other methods in this extension to the JDBC Connection Interface; it is a change made to make usage of the API go down easier. The supposition is that the bulk of usage will be concerned with RelationalStatement rather than plain Statement and so we skirt the need for a Statement#unwrap to get access to the Relational facility. We may come back to redo this convenience later if this API 'anomaly' on the JDBC API proves a thorn.- Specified by:
createStatement
in interfaceConnection
- Returns:
- A new statement entity to manipulate the database with.
- Throws:
SQLException
- if something goes wrong while creating a statement.
-
prepareStatement
Creates aRelationalPreparedStatement
object for sending parameterized SQL statements to the database.A SQL statement with or without IN parameters can be pre-compiled and stored in a
PreparedStatement
object. This object can then be used to efficiently execute this statement multiple times.- Specified by:
prepareStatement
in interfaceConnection
- Parameters:
sql
- an SQL statement that may contain one or more '?' IN parameter placeholders- Returns:
- a new default
RelationalPreparedStatement
object containing the pre-compiled SQL statement - Throws:
SQLException
- if a database access error occurs or this method is called on a closed connection
-
getOptions
-
setOption
- Throws:
SQLException
-
getPath
URI getPath() -
createStatement
- Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
createStatement
default Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
default PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
default PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
prepareCall
default CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
prepareCall
default CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
nativeSQL
- Specified by:
nativeSQL
in interfaceConnection
- Throws:
SQLException
-
abort
- Specified by:
abort
in interfaceConnection
- Throws:
SQLException
-
setNetworkTimeout
- Specified by:
setNetworkTimeout
in interfaceConnection
- Throws:
SQLException
-
getNetworkTimeout
- Specified by:
getNetworkTimeout
in interfaceConnection
- Throws:
SQLException
-
setReadOnly
- Specified by:
setReadOnly
in interfaceConnection
- Throws:
SQLException
-
isReadOnly
- Specified by:
isReadOnly
in interfaceConnection
- Throws:
SQLException
-
setCatalog
- Specified by:
setCatalog
in interfaceConnection
- Throws:
SQLException
-
getCatalog
- Specified by:
getCatalog
in interfaceConnection
- Throws:
SQLException
-
getWarnings
- Specified by:
getWarnings
in interfaceConnection
- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarnings
in interfaceConnection
- Throws:
SQLException
-
getTypeMap
- Specified by:
getTypeMap
in interfaceConnection
- Throws:
SQLException
-
setTypeMap
- Specified by:
setTypeMap
in interfaceConnection
- Throws:
SQLException
-
setHoldability
- Specified by:
setHoldability
in interfaceConnection
- Throws:
SQLException
-
getHoldability
- Specified by:
getHoldability
in interfaceConnection
- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepoint
in interfaceConnection
- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepoint
in interfaceConnection
- Throws:
SQLException
-
rollback
- Specified by:
rollback
in interfaceConnection
- Throws:
SQLException
-
releaseSavepoint
- Specified by:
releaseSavepoint
in interfaceConnection
- Throws:
SQLException
-
createClob
- Specified by:
createClob
in interfaceConnection
- Throws:
SQLException
-
createBlob
- Specified by:
createBlob
in interfaceConnection
- Throws:
SQLException
-
createNClob
- Specified by:
createNClob
in interfaceConnection
- Throws:
SQLException
-
createSQLXML
- Specified by:
createSQLXML
in interfaceConnection
- Throws:
SQLException
-
isValid
- Specified by:
isValid
in interfaceConnection
- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfo
in interfaceConnection
- Throws:
SQLClientInfoException
-
setClientInfo
- Specified by:
setClientInfo
in interfaceConnection
- Throws:
SQLClientInfoException
-
getClientInfo
- Specified by:
getClientInfo
in interfaceConnection
- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfo
in interfaceConnection
- Throws:
SQLException
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
createStatementBuilderFactory
- Throws:
SQLException
-
createExpressionBuilderFactory
- Throws:
SQLException
-