Class Driver

java.lang.Object
org.apache.calcite.avatica.UnregisteredDriver
org.apache.calcite.jdbc.Driver
All Implemented Interfaces:
Driver
Direct Known Subclasses:
SplunkDriver

public class Driver extends org.apache.calcite.avatica.UnregisteredDriver
Calcite JDBC driver.
  • Field Details

  • Constructor Details

    • Driver

      public Driver()
      Creates a Driver.
    • Driver

      protected Driver(@Nullable Supplier<CalcitePrepare> prepareFactory)
      Creates a Driver with a factory for CalcitePrepare objects; if the factory is null, the driver will call createPrepareFactory().
  • Method Details

    • withPrepareFactory

      public Driver withPrepareFactory(Supplier<CalcitePrepare> prepareFactory)
      Creates a copy of this Driver with a new factory for creating CalcitePrepare.

      Allows users of the Driver to change the factory without subclassing the Driver. But subclasses of the driver should override this method to create an instance of their subclass.

      Parameters:
      prepareFactory - Supplier of a CalcitePrepare
      Returns:
      Driver with the provided prepareFactory
    • createPrepare

      public CalcitePrepare createPrepare()
      Creates a CalcitePrepare to be used to prepare a statement for execution.

      If you wish to use a custom prepare, either override this method or call withPrepareFactory(Supplier).

    • createPrepareFactory

      @Deprecated protected Function0<CalcitePrepare> createPrepareFactory()
      Deprecated.
      Returns a factory with which to create a CalcitePrepare.

      Now deprecated; if you wish to use a custom prepare, overrides of this method will still work, but we prefer that you call withPrepareFactory(Supplier) or override createPrepare().

    • getConnectStringPrefix

      protected String getConnectStringPrefix()
      Specified by:
      getConnectStringPrefix in class org.apache.calcite.avatica.UnregisteredDriver
    • getFactoryClassName

      protected String getFactoryClassName(org.apache.calcite.avatica.UnregisteredDriver.JdbcVersion jdbcVersion)
      Overrides:
      getFactoryClassName in class org.apache.calcite.avatica.UnregisteredDriver
    • createDriverVersion

      protected org.apache.calcite.avatica.DriverVersion createDriverVersion()
      Specified by:
      createDriverVersion in class org.apache.calcite.avatica.UnregisteredDriver
    • createHandler

      protected org.apache.calcite.avatica.Handler createHandler()
      Overrides:
      createHandler in class org.apache.calcite.avatica.UnregisteredDriver
    • getConnectionProperties

      protected Collection<org.apache.calcite.avatica.ConnectionProperty> getConnectionProperties()
      Overrides:
      getConnectionProperties in class org.apache.calcite.avatica.UnregisteredDriver
    • createMeta

      public org.apache.calcite.avatica.Meta createMeta(org.apache.calcite.avatica.AvaticaConnection connection)
      Specified by:
      createMeta in class org.apache.calcite.avatica.UnregisteredDriver