Interface RelationalConnection
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.sql.Connection
,java.sql.Wrapper
public interface RelationalConnection extends java.sql.Connection
A connection to a Relational database.This functions very much like a
Connection
, but contains some overloaded methods to supportRelationalStatement
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
abort(java.util.concurrent.Executor executor)
default void
clearWarnings()
default java.sql.Blob
createBlob()
default java.sql.Clob
createClob()
default ExpressionFactory
createExpressionBuilderFactory()
default java.sql.NClob
createNClob()
default java.sql.SQLXML
createSQLXML()
RelationalStatement
createStatement()
Create a RelationalStatement which can be executed using this DatabaseConnection.default java.sql.Statement
createStatement(int resultSetType, int resultSetConcurrency)
default java.sql.Statement
createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
default StatementBuilderFactory
createStatementBuilderFactory()
default java.lang.String
getCatalog()
default java.util.Properties
getClientInfo()
default java.lang.String
getClientInfo(java.lang.String name)
default int
getHoldability()
default int
getNetworkTimeout()
Options
getOptions()
java.net.URI
getPath()
default java.util.Map<java.lang.String,java.lang.Class<?>>
getTypeMap()
default java.sql.SQLWarning
getWarnings()
default boolean
isReadOnly()
default boolean
isValid(int timeout)
default boolean
isWrapperFor(java.lang.Class<?> iface)
default java.lang.String
nativeSQL(java.lang.String sql)
default java.sql.CallableStatement
prepareCall(java.lang.String sql)
default java.sql.CallableStatement
prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency)
default java.sql.CallableStatement
prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
RelationalPreparedStatement
prepareStatement(java.lang.String sql)
Creates aRelationalPreparedStatement
object for sending parameterized SQL statements to the database.default java.sql.PreparedStatement
prepareStatement(java.lang.String sql, int autoGeneratedKeys)
default java.sql.PreparedStatement
prepareStatement(java.lang.String sql, int[] columnIndexes)
default java.sql.PreparedStatement
prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency)
default java.sql.PreparedStatement
prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
default java.sql.PreparedStatement
prepareStatement(java.lang.String sql, java.lang.String[] columnNames)
default void
releaseSavepoint(java.sql.Savepoint savepoint)
default void
rollback(java.sql.Savepoint savepoint)
default void
setCatalog(java.lang.String catalog)
default void
setClientInfo(java.lang.String name, java.lang.String value)
default void
setClientInfo(java.util.Properties properties)
default void
setHoldability(int holdability)
default void
setNetworkTimeout(java.util.concurrent.Executor executor, int milliseconds)
void
setOption(Options.Name name, java.lang.Object value)
default void
setReadOnly(boolean readOnly)
default java.sql.Savepoint
setSavepoint()
default java.sql.Savepoint
setSavepoint(java.lang.String name)
default void
setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
default <T> T
unwrap(java.lang.Class<T> iface)
-
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 Detail
-
createStatement
RelationalStatement createStatement() throws java.sql.SQLException
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 interfacejava.sql.Connection
- Returns:
- A new statement entity to manipulate the database with.
- Throws:
java.sql.SQLException
- if something goes wrong while creating a statement.
-
prepareStatement
RelationalPreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
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 interfacejava.sql.Connection
- 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:
java.sql.SQLException
- if a database access error occurs or this method is called on a closed connection
-
getOptions
@Nonnull Options getOptions()
-
setOption
void setOption(Options.Name name, java.lang.Object value) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getPath
java.net.URI getPath()
-
createStatement
default java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
- Specified by:
createStatement
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
createStatement
default java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
- Specified by:
createStatement
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
prepareStatement
default java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
- Specified by:
prepareStatement
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
prepareStatement
default java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
- Specified by:
prepareStatement
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
prepareStatement
default java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
- Specified by:
prepareStatement
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
prepareStatement
default java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
- Specified by:
prepareStatement
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
prepareStatement
default java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
- Specified by:
prepareStatement
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
prepareCall
default java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
- Specified by:
prepareCall
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
prepareCall
default java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
- Specified by:
prepareCall
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
prepareCall
default java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
- Specified by:
prepareCall
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
nativeSQL
default java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
- Specified by:
nativeSQL
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
abort
default void abort(java.util.concurrent.Executor executor) throws java.sql.SQLException
- Specified by:
abort
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
setNetworkTimeout
default void setNetworkTimeout(java.util.concurrent.Executor executor, int milliseconds) throws java.sql.SQLException
- Specified by:
setNetworkTimeout
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
getNetworkTimeout
default int getNetworkTimeout() throws java.sql.SQLException
- Specified by:
getNetworkTimeout
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
setReadOnly
default void setReadOnly(boolean readOnly) throws java.sql.SQLException
- Specified by:
setReadOnly
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
isReadOnly
default boolean isReadOnly() throws java.sql.SQLException
- Specified by:
isReadOnly
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
setCatalog
default void setCatalog(java.lang.String catalog) throws java.sql.SQLException
- Specified by:
setCatalog
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
getCatalog
default java.lang.String getCatalog() throws java.sql.SQLException
- Specified by:
getCatalog
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
getWarnings
default java.sql.SQLWarning getWarnings() throws java.sql.SQLException
- Specified by:
getWarnings
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
clearWarnings
default void clearWarnings() throws java.sql.SQLException
- Specified by:
clearWarnings
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
getTypeMap
default java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap() throws java.sql.SQLException
- Specified by:
getTypeMap
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
setTypeMap
default void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map) throws java.sql.SQLException
- Specified by:
setTypeMap
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
setHoldability
default void setHoldability(int holdability) throws java.sql.SQLException
- Specified by:
setHoldability
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
getHoldability
default int getHoldability() throws java.sql.SQLException
- Specified by:
getHoldability
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
setSavepoint
default java.sql.Savepoint setSavepoint() throws java.sql.SQLException
- Specified by:
setSavepoint
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
setSavepoint
default java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
- Specified by:
setSavepoint
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
rollback
default void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
- Specified by:
rollback
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
releaseSavepoint
default void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
- Specified by:
releaseSavepoint
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
createClob
default java.sql.Clob createClob() throws java.sql.SQLException
- Specified by:
createClob
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
createBlob
default java.sql.Blob createBlob() throws java.sql.SQLException
- Specified by:
createBlob
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
createNClob
default java.sql.NClob createNClob() throws java.sql.SQLException
- Specified by:
createNClob
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
createSQLXML
default java.sql.SQLXML createSQLXML() throws java.sql.SQLException
- Specified by:
createSQLXML
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
isValid
default boolean isValid(int timeout) throws java.sql.SQLException
- Specified by:
isValid
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
setClientInfo
default void setClientInfo(java.lang.String name, java.lang.String value) throws java.sql.SQLClientInfoException
- Specified by:
setClientInfo
in interfacejava.sql.Connection
- Throws:
java.sql.SQLClientInfoException
-
setClientInfo
default void setClientInfo(java.util.Properties properties) throws java.sql.SQLClientInfoException
- Specified by:
setClientInfo
in interfacejava.sql.Connection
- Throws:
java.sql.SQLClientInfoException
-
getClientInfo
default java.lang.String getClientInfo(java.lang.String name) throws java.sql.SQLException
- Specified by:
getClientInfo
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
getClientInfo
default java.util.Properties getClientInfo() throws java.sql.SQLException
- Specified by:
getClientInfo
in interfacejava.sql.Connection
- Throws:
java.sql.SQLException
-
unwrap
default <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
- Specified by:
unwrap
in interfacejava.sql.Wrapper
- Throws:
java.sql.SQLException
-
isWrapperFor
default boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
- Specified by:
isWrapperFor
in interfacejava.sql.Wrapper
- Throws:
java.sql.SQLException
-
createStatementBuilderFactory
@Nonnull default StatementBuilderFactory createStatementBuilderFactory() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
createExpressionBuilderFactory
@Nonnull default ExpressionFactory createExpressionBuilderFactory() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-