com.jn.sqlhelper.dialect.DialectResolutionInfo Maven / Gradle / Ivy
package com.jn.sqlhelper.dialect;
/**
* Exposes information about the database and JDBC driver that can be used in resolving the appropriate Dialect
* to use.
*
* The information here mimics part of the JDBC {@link java.sql.DatabaseMetaData} contract, specifically the portions
* about database and driver names and versions.
*
* @author Steve Ebersole
*/
public interface DialectResolutionInfo {
/**
* Constant used to indicate that no version is defined
*/
public static final int NO_VERSION = -9999;
/**
* Obtain access to the database name, as returned from {@link java.sql.DatabaseMetaData#getDatabaseProductName()}
* for the target database
*
* @return The database name
*
* @see java.sql.DatabaseMetaData#getDatabaseProductName()
*/
public String getDatabaseProductName();
public String getDatabaseProductVersion();
/**
* Obtain access to the database major version, as returned from
* {@link java.sql.DatabaseMetaData#getDatabaseMajorVersion()} for the target database.
*
* @return The database major version, or {@value #NO_VERSION} to indicate "no version information"
*
* @see java.sql.DatabaseMetaData#getDatabaseMajorVersion()
*/
public int getDatabaseMajorVersion();
/**
* Obtain access to the database minor version, as returned from
* {@link java.sql.DatabaseMetaData#getDatabaseMinorVersion()} for the target database.
*
* @return The database minor version, or {@value #NO_VERSION} to indicate "no version information"
*
* @see java.sql.DatabaseMetaData#getDatabaseMinorVersion()
*/
public int getDatabaseMinorVersion();
/**
* Obtain access to the name of the JDBC driver, as returned from {@link java.sql.DatabaseMetaData#getDriverName()}
* for the target database
*
* @return The JDBC driver name
*
* @see java.sql.DatabaseMetaData#getDriverName()
*/
public String getDriverName();
/**
* Obtain access to the major version of the JDBC driver, as returned from
* {@link java.sql.DatabaseMetaData#getDriverMajorVersion()} ()} for the target database.
*
* @return The JDBC driver major version, or {@value #NO_VERSION} to indicate "no version information"
*
* @see java.sql.DatabaseMetaData#getDriverMajorVersion()
*/
public int getDriverMajorVersion();
/**
* Obtain access to the minor version of the JDBC driver, as returned from
* {@link java.sql.DatabaseMetaData#getDriverMinorVersion()} for the target database.
*
* @return The JDBC driver minor version, or {@value #NO_VERSION} to indicate "no version information"
*
* @see java.sql.DatabaseMetaData#getDriverMinorVersion()
*/
public int getDriverMinorVersion();
}