org.apache.calcite.avatica

## Class DriverVersion

- java.lang.Object
- - org.apache.calcite.avatica.DriverVersion

    public class DriverVersion
    extends Object

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
`int` `databaseMajorVersion`
`int` `databaseMinorVersion`
`boolean` `jdbcCompliant`
`int` `majorVersion`
`int` `minorVersion`
`String` `name`
`String` `productName`
`String` `productVersion`
`String` `versionString`

### Constructor Summary

Constructors
Constructor and Description
`DriverVersion(String name, String versionString, String productName, String productVersion, boolean jdbcCompliant, int majorVersion, int minorVersion, int databaseMajorVersion, int databaseMinorVersion)` Creates a DriverVersion.

### Method Summary

Methods
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### majorVersion

    public final int majorVersion

#### minorVersion

    public final int minorVersion

#### name

    public final String name

#### versionString

    public final String versionString

#### productName

    public final String productName

#### productVersion

    public final String productVersion

#### jdbcCompliant

    public final boolean jdbcCompliant

#### databaseMajorVersion

    public final int databaseMajorVersion

#### databaseMinorVersion

    public final int databaseMinorVersion

### Constructor Detail

#### DriverVersion

    public DriverVersion(String name,
                 String versionString,
                 String productName,
                 String productVersion,
                 boolean jdbcCompliant,
                 int majorVersion,
                 int minorVersion,
                 int databaseMajorVersion,
                 int databaseMinorVersion)

Creates a DriverVersion.

### Method Detail

#### 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 resource
  `resourceName` - Name of resource file
  `driverName` - Fallback name of driver
  `driverVersion` - Fallback version of driver
  `productName` - Fallback product name
  `productVersion` - Fallback product version
Returns:
  A populated driver version object, never null