Package 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
Modifier and Type
Field
Description
`final int`
`databaseMajorVersion`
`final int`
`databaseMinorVersion`
`final boolean`
`jdbcCompliant`
`final int`
`majorVersion`
`final int`
`minorVersion`
`final String`
`name`
`final String`
`productName`
`final String`
`productVersion`
`final String`
`versionString`

## Constructor Summary

Constructors
Constructor
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

Modifier and Type
Method
Description
`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 Details

### 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 Details

### 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 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 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