Class DBType

java.lang.Object
overit.geocall.sql.DBType

public class DBType extends Object
This class implements the object that defines a DataBase type.

An example of string, useful for testing, that defines a database is: "Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options".

  • Field Details

    • DB_UNLOADED

      public static final int DB_UNLOADED
      Not loaded database
      See Also:
    • DB_UNKNOWN

      public static final int DB_UNKNOWN
      Unknown database type
      See Also:
    • DB_ORACLE

      public static final int DB_ORACLE
      Oracle database
      See Also:
    • DB_MYSQL

      public static final int DB_MYSQL
      MySQL database
      See Also:
    • DB_POSTGRES

      public static final int DB_POSTGRES
      PostgreSQL database
      See Also:
    • DB_SQLSERVER

      public static final int DB_SQLSERVER
      SqlServer database
      See Also:
    • DB_HSQLDB

      public static final int DB_HSQLDB
      HSQLDB database.
      See Also:
    • _chartag

      protected static char[] _chartag
    • _productName

      protected String _productName
    • _productVersion

      protected String _productVersion
    • _type

      protected int _type
    • metadata

      protected overit.geocall.sql.DBMetadata metadata
    • _release

      protected String _release
    • _major

      protected int _major
    • _minor

      protected int _minor
    • _driverMajor

      protected int _driverMajor
    • _driverMinor

      protected int _driverMinor
  • Constructor Details

    • DBType

      public DBType()
      Main constructor
    • DBType

      public DBType(DatabaseMetaData dmd)
      Creates a DBType object starting from the DatabaseMetaData, ie the comprehensive information about the database as a whole, passed as parameter
      Parameters:
      dmd - The informations about the database
  • Method Details

    • charTag

      public static char charTag(int dbtype)
      Returns the character used as a tag for the database type
      Parameters:
      dbtype - One of DB_UNLOADED, DB_UNKNOWN, DB_ORACLE, DB_MYSQL, DB_POSTGRES, DB_HSQLDB.
      Returns:
      ' ' for unloaded, 'o' for oracle, 'm' for mysql, 'p' for posgresql, 'h' for hsqldb.
    • matchDBType

      public static boolean matchDBType(DatabaseMetaData dmd, int type) throws SQLException
      Throws:
      SQLException
    • getMajorRelease

      public int getMajorRelease()
      Returns the value of the major release of the database
      Returns:
      The major release
    • getMinorRelease

      public int getMinorRelease()
      Returns the value of the minor releqase of the database
      Returns:
      The minor release
    • getDriverMajorRelease

      public int getDriverMajorRelease()
      Returns the value of the major release of the driver
      Returns:
      The major release
    • getDriverMinorRelease

      public int getDriverMinorRelease()
      Returns the value of the minor releqase of the driver
      Returns:
      The minor release
    • getType

      public int getType()
      Returns the integer that defines the type of the database
      Returns:
      One of DB_UNLOADED, DB_UNKNOWN, DB_ORACLE, DB_MYSQL, DB_POSTGRES, DB_HSQLDB.
    • getMetadata

      public overit.geocall.sql.DBMetadata getMetadata()
      Return DBMetadata that can be used to retrieve information about DB tables and table-spaces
      Returns:
      the DBMetadata instance based on the current db type
    • getRelease

      public String getRelease()
      Returns the string that describes the release of the database
      Returns:
      The release of the database