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 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 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 interface java.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 a RelationalPreparedStatement 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 interface java.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 interface java.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 interface java.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 interface java.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 interface java.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 interface java.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 interface java.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 interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • prepareCall

        default java.sql.CallableStatement prepareCall​(java.lang.String sql)
                                                throws java.sql.SQLException
        Specified by:
        prepareCall in interface java.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 interface java.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 interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • nativeSQL

        default java.lang.String nativeSQL​(java.lang.String sql)
                                    throws java.sql.SQLException
        Specified by:
        nativeSQL in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • abort

        default void abort​(java.util.concurrent.Executor executor)
                    throws java.sql.SQLException
        Specified by:
        abort in interface java.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 interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • getNetworkTimeout

        default int getNetworkTimeout()
                               throws java.sql.SQLException
        Specified by:
        getNetworkTimeout in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • setReadOnly

        default void setReadOnly​(boolean readOnly)
                          throws java.sql.SQLException
        Specified by:
        setReadOnly in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • isReadOnly

        default boolean isReadOnly()
                            throws java.sql.SQLException
        Specified by:
        isReadOnly in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • setCatalog

        default void setCatalog​(java.lang.String catalog)
                         throws java.sql.SQLException
        Specified by:
        setCatalog in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • getCatalog

        default java.lang.String getCatalog()
                                     throws java.sql.SQLException
        Specified by:
        getCatalog in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • getWarnings

        default java.sql.SQLWarning getWarnings()
                                         throws java.sql.SQLException
        Specified by:
        getWarnings in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • clearWarnings

        default void clearWarnings()
                            throws java.sql.SQLException
        Specified by:
        clearWarnings in interface java.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 interface java.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 interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • setHoldability

        default void setHoldability​(int holdability)
                             throws java.sql.SQLException
        Specified by:
        setHoldability in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • getHoldability

        default int getHoldability()
                            throws java.sql.SQLException
        Specified by:
        getHoldability in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • setSavepoint

        default java.sql.Savepoint setSavepoint()
                                         throws java.sql.SQLException
        Specified by:
        setSavepoint in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • setSavepoint

        default java.sql.Savepoint setSavepoint​(java.lang.String name)
                                         throws java.sql.SQLException
        Specified by:
        setSavepoint in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • rollback

        default void rollback​(java.sql.Savepoint savepoint)
                       throws java.sql.SQLException
        Specified by:
        rollback in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • releaseSavepoint

        default void releaseSavepoint​(java.sql.Savepoint savepoint)
                               throws java.sql.SQLException
        Specified by:
        releaseSavepoint in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • createClob

        default java.sql.Clob createClob()
                                  throws java.sql.SQLException
        Specified by:
        createClob in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • createBlob

        default java.sql.Blob createBlob()
                                  throws java.sql.SQLException
        Specified by:
        createBlob in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • createNClob

        default java.sql.NClob createNClob()
                                    throws java.sql.SQLException
        Specified by:
        createNClob in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • createSQLXML

        default java.sql.SQLXML createSQLXML()
                                      throws java.sql.SQLException
        Specified by:
        createSQLXML in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • isValid

        default boolean isValid​(int timeout)
                         throws java.sql.SQLException
        Specified by:
        isValid in interface java.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 interface java.sql.Connection
        Throws:
        java.sql.SQLClientInfoException
      • setClientInfo

        default void setClientInfo​(java.util.Properties properties)
                            throws java.sql.SQLClientInfoException
        Specified by:
        setClientInfo in interface java.sql.Connection
        Throws:
        java.sql.SQLClientInfoException
      • getClientInfo

        default java.lang.String getClientInfo​(java.lang.String name)
                                        throws java.sql.SQLException
        Specified by:
        getClientInfo in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • getClientInfo

        default java.util.Properties getClientInfo()
                                            throws java.sql.SQLException
        Specified by:
        getClientInfo in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • unwrap

        default <T> T unwrap​(java.lang.Class<T> iface)
                      throws java.sql.SQLException
        Specified by:
        unwrap in interface java.sql.Wrapper
        Throws:
        java.sql.SQLException
      • isWrapperFor

        default boolean isWrapperFor​(java.lang.Class<?> iface)
                              throws java.sql.SQLException
        Specified by:
        isWrapperFor in interface java.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