Package org.apache.calcite.avatica
Class DriverVersion
java.lang.Object
org.apache.calcite.avatica.DriverVersion
Driver version information.
Each driver implementation must provide an instance of this class, in
order to implement UnregisteredDriver.createDriverVersion().
There are two typical ways for a driver to instantiate its version information:
- A driver might create a subclass in a with a constructor that provides all of the arguments for the base class. The instance is held in a separate file, so that that version information can be generated.
- A driver might store the version information in a .properties file and
load it using
load(java.lang.Class<? extends org.apache.calcite.avatica.UnregisteredDriver>, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDriverVersion(String name, String versionString, String productName, String productVersion, boolean jdbcCompliant, int majorVersion, int minorVersion, int databaseMajorVersion, int databaseMinorVersion) Creates a DriverVersion. -
Method Summary
Modifier and TypeMethodDescriptionstatic DriverVersionload(Class<? extends UnregisteredDriver> driverClass, String resourceName, String driverName, String driverVersion, String productName, String productVersion) Loads a driver version from a properties file, read from the classpath.
-
Field Details
-
majorVersion
public final int majorVersion -
minorVersion
public final int minorVersion -
name
-
versionString
-
productName
-
productVersion
-
jdbcCompliant
public final boolean jdbcCompliant -
databaseMajorVersion
public final int databaseMajorVersion -
databaseMinorVersion
public final int databaseMinorVersion
-
-
Constructor Details
-
Method Details
-
load
public static DriverVersion load(Class<? extends UnregisteredDriver> driverClass, String resourceName, String driverName, String driverVersion, String productName, String productVersion) Loads a driver version from a properties file, read from the classpath. The arguments provide defaults if the properties cannot be loaded.- Parameters:
driverClass- Class of driver; used to find resourceresourceName- Name of resource filedriverName- Fallback name of driverdriverVersion- Fallback version of driverproductName- Fallback product nameproductVersion- Fallback product version- Returns:
- A populated driver version object, never null
-