Interface CalciteConnection

  • All Superinterfaces:
    java.lang.AutoCloseable, java.sql.Connection, QueryProvider, java.sql.Wrapper
    All Known Implementing Classes:
    CalciteConnectionImpl, CalciteJdbc41Factory.CalciteJdbc41Connection

    public interface CalciteConnection
    extends java.sql.Connection, QueryProvider
    Extension to Calcite's implementation of JDBC connection allows schemas to be defined dynamically.

    You can start off with an empty connection (no schemas), define one or two schemas, and start querying them.

    Since a CalciteConnection implements the linq4j QueryProvider interface, you can use a connection to execute expression trees as queries.

    • Field Summary

      • Fields inherited from interface java.sql.Connection

        TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      CalciteConnectionConfig config()  
      CalcitePrepare.Context createPrepareContext()
      Creates a context for preparing a statement for execution.
      java.util.Properties getProperties()
      Returns an instance of the connection properties.
      SchemaPlus getRootSchema()
      Returns the root schema.
      java.lang.String getSchema()  
      JavaTypeFactory getTypeFactory()
      Returns the type factory.
      void setSchema​(java.lang.String schema)  
      • 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, 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, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid, setTransactionIsolation, setTypeMap
      • Methods inherited from interface java.sql.Wrapper

        isWrapperFor, unwrap
    • Method Detail

      • getRootSchema

        SchemaPlus getRootSchema()
        Returns the root schema.

        You can define objects (such as relations) in this schema, and also nested schemas.

        Returns:
        Root schema
      • getTypeFactory

        JavaTypeFactory getTypeFactory()
        Returns the type factory.
        Returns:
        Type factory
      • getProperties

        java.util.Properties getProperties()
        Returns an instance of the connection properties.

        NOTE: The resulting collection of properties is same collection used by the connection, and is writable, but behavior if you modify the collection is undefined. Some implementations might, for example, see a modified property, but only if you set it before you create a statement. We will remove this method when there are better implementations of stateful connections and configuration.

        Returns:
        properties
      • setSchema

        void setSchema​(java.lang.String schema)
                throws java.sql.SQLException
        Specified by:
        setSchema in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • getSchema

        java.lang.String getSchema()
                            throws java.sql.SQLException
        Specified by:
        getSchema in interface java.sql.Connection
        Throws:
        java.sql.SQLException
      • createPrepareContext

        CalcitePrepare.Context createPrepareContext()
        Creates a context for preparing a statement for execution.