Package overit.geocall.sql
Class DBType
java.lang.Object
overit.geocall.sql.DBType
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static char[]protected intprotected intprotected intprotected intprotected Stringprotected Stringprotected Stringprotected intstatic final intHSQLDB database.static final intMySQL databasestatic final intOracle databasestatic final intPostgreSQL databasestatic final intSqlServer databasestatic final intUnknown database typestatic final intNot loaded databaseprotected overit.geocall.sql.DBMetadata -
Constructor Summary
ConstructorsConstructorDescriptionDBType()Main constructorDBType(DatabaseMetaData dmd) Creates a DBType object starting from theDatabaseMetaData, ie the comprehensive information about the database as a whole, passed as parameter -
Method Summary
Modifier and TypeMethodDescriptionstatic charcharTag(int dbtype) Returns the character used as a tag for the database typeintReturns the value of the major release of the driverintReturns the value of the minor releqase of the driverintReturns the value of the major release of the databaseoverit.geocall.sql.DBMetadataReturnDBMetadatathat can be used to retrieve information about DB tables and table-spacesintReturns the value of the minor releqase of the databaseReturns the string that describes the release of the databaseintgetType()Returns the integer that defines the type of the databasestatic booleanmatchDBType(DatabaseMetaData dmd, int type)
-
Field Details
-
DB_UNLOADED
public static final int DB_UNLOADEDNot loaded database- See Also:
-
DB_UNKNOWN
public static final int DB_UNKNOWNUnknown database type- See Also:
-
DB_ORACLE
public static final int DB_ORACLEOracle database- See Also:
-
DB_MYSQL
public static final int DB_MYSQLMySQL database- See Also:
-
DB_POSTGRES
public static final int DB_POSTGRESPostgreSQL database- See Also:
-
DB_SQLSERVER
public static final int DB_SQLSERVERSqlServer database- See Also:
-
DB_HSQLDB
public static final int DB_HSQLDBHSQLDB database.- See Also:
-
_chartag
protected static char[] _chartag -
_productName
-
_productVersion
-
_type
protected int _type -
metadata
protected overit.geocall.sql.DBMetadata metadata -
_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
Creates a DBType object starting from theDatabaseMetaData, 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 ofDB_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
- 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()ReturnDBMetadatathat can be used to retrieve information about DB tables and table-spaces- Returns:
- the
DBMetadatainstance based on the current db type
-
getRelease
Returns the string that describes the release of the database- Returns:
- The release of the database
-