|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.sqltools.sqlbuilder.model.DBVersionHelper
public class DBVersionHelper
This class provides database product (platform) and version information for a particular database. The database version consists of three integers: version, release, and mod level. This class supports comparisons between versions, as well as comparisons against specified version, release, and mod levels. Note: this class is adapted from Development Center's DB2Version class.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_FAMILY
|
static java.lang.String |
DEFAULT_PRODUCT
|
static java.lang.String |
DEFAULT_VERSION_STRING
|
static java.lang.String |
FAMILY_CLOUDSCAPE
|
static java.lang.String |
FAMILY_DB2
|
static java.lang.String |
FAMILY_INFORMIX
|
static java.lang.String |
FAMILY_MYSQL
|
static java.lang.String |
FAMILY_ORACLE
|
static java.lang.String |
FAMILY_SQL_SERVER
|
static java.lang.String |
FAMILY_SYBASE
|
static java.lang.String |
ID_APACHE_DERBY
|
static java.lang.String |
ID_AS
|
static java.lang.String |
ID_AS400
|
static java.lang.String |
ID_DB2
|
static java.lang.String |
ID_DB2_EVERYPLACE
|
static java.lang.String |
ID_DB2_PREFIX
|
static java.lang.String |
ID_DB2_UDB
|
static java.lang.String |
ID_DB2_UDB_AS400
|
static java.lang.String |
ID_DB2_UDB_ISERIES
|
static java.lang.String |
ID_DB2_UDB_ZSERIES
|
static java.lang.String |
ID_DB2400_SQL
|
static java.lang.String |
ID_DERBY
|
static java.lang.String |
ID_IBM_CLOUDSCAPE
|
static java.lang.String |
ID_INFORMIX
|
static java.lang.String |
ID_MYSQL
|
static java.lang.String |
ID_ORACLE
|
static java.lang.String |
ID_SQL_SERVER
|
static java.lang.String |
ID_SQLDS
|
static java.lang.String |
ID_SYBASE_ASA
|
static java.lang.String |
ID_SYBASE_ASE
|
static java.lang.String |
ID_WORKSTATION
|
static java.lang.String |
PRODUCT_CLOUDSCAPE
|
static java.lang.String |
PRODUCT_DB2_EVERYPLACE
|
static java.lang.String |
PRODUCT_DB2_ISERIES
|
static java.lang.String |
PRODUCT_DB2_LUW
|
static java.lang.String |
PRODUCT_DB2_VMVSE
|
static java.lang.String |
PRODUCT_DB2_ZOS
|
static java.lang.String |
PRODUCT_DERBY
|
static java.lang.String |
PRODUCT_INFORMIX
|
static java.lang.String |
PRODUCT_MYSQL
|
static java.lang.String |
PRODUCT_ORACLE
|
static java.lang.String |
PRODUCT_SQL_SERVER
|
static java.lang.String |
PRODUCT_SYBASE_ASA
|
static java.lang.String |
PRODUCT_SYBASE_ASE
|
Constructor Summary | |
---|---|
DBVersionHelper()
Constructs an instance of this class. |
|
DBVersionHelper(java.sql.Connection conn)
Constructs an instance of this class using the given JDBC connection object. |
|
DBVersionHelper(Database db)
Constructs an instance of this class using the given Database
object. |
|
DBVersionHelper(DBVersionHelper other)
Constructs an instance of this class as a copy of the given instance of this class. |
|
DBVersionHelper(int version,
int release,
int mod)
Constructs an instance of this class using the given version, release, and mod level numbers. |
|
DBVersionHelper(ISQLEditorConnectionInfo connInfo)
Constructs an instance of this class using the given ISQLEditorConnectionInfo
object. |
|
DBVersionHelper(java.lang.String versionString)
Constructs an instance of this class using the given version string. |
|
DBVersionHelper(java.lang.String productFamily,
java.lang.String product,
int version,
int release,
int mod)
Constructs an instance of this class using the given product family, product, version, release, and mod level numbers. |
Method Summary | |
---|---|
int |
getMod()
Gets the mod level. |
java.lang.String |
getProduct()
Gets the database product. |
java.lang.String |
getProductFamily()
Gets the database product family. |
java.lang.String |
getProductIDString()
Gets the database product ID string that was used to determine the product. |
int |
getRelease()
Gets the release level. |
int |
getVersion()
Gets the version. |
java.lang.String |
getVersionString()
Gets the current version string. |
boolean |
isAtLeast(int version)
Gets whether or not the version of this database is at least as high as the given version. |
boolean |
isAtLeast(int version,
int release)
Gets whether or not the version and release of this database is at least as high as the given version and release. |
boolean |
isAtLeast(int version,
int release,
int mod)
Gets whether or not the version, release, and mod level of this database is at least the given version, release, and mod level. |
boolean |
isAtMost(int version)
Gets whether or not the version of this database is at most the given version. |
boolean |
isAtMost(int version,
int release)
Gets whether or not the version and release of this database are at most the given version and release. |
boolean |
isAtMost(int version,
int release,
int mod)
Gets whether or not the version, release, and mod level of this database are at most the given version, release, and mod level. |
boolean |
isCloudscape()
Gets whether or not this database is IBM Cloudscape. |
boolean |
isDB2_390()
Gets whether or not this database is a DB2 for OS/390. |
boolean |
isDB2_400()
Gets whether or not this database is a DB2 for OS/400. |
boolean |
isDB2_Everyplace()
Gets whether or not this database is a DB2 Everyplace. |
boolean |
isDB2_iSeries()
Gets whether or not the database is DB2 for iSeries. |
boolean |
isDB2_LUW()
Gets whether or not this database is a DB2 for Linux/Unix/Windows |
boolean |
isDB2_UDB()
Gets whether or not this database is a flavor of DB2 UDB. |
boolean |
isDB2_VMVSE()
Gets whether or not this database is DB2 for VM/VSE (SQL/DS). |
boolean |
isDB2_zOS()
Gets whether or not this database is DB2 for zOS. |
boolean |
isDB2()
Gets whether or not this database is a DB2 of any flavor. |
boolean |
isDerby()
Gets whether or not this database is Derby (AKA Cloudscape). |
boolean |
isExactly(int version)
Gets whether or not the version of this database is exactly the given version. |
boolean |
isExactly(int version,
int release)
Gets whether or not the version and release of this database are exactly the given version and release. |
boolean |
isExactly(int version,
int release,
int mod)
Gets whether or not the version, release, and mod level of this database are exactly the given version, release, and mod level. |
boolean |
isInformix()
Gets whether or not the database is Informix. |
boolean |
isMySQL()
Gets whether or not the database is mySQL. |
boolean |
isOracle()
Gets whether or not the database is Oracle. |
boolean |
isSQLServer()
Gets whether or not the database is SQL Server. |
boolean |
isSybase_ASA()
Gets whether or not the database is Sybase ASA. |
boolean |
isSybase_ASE()
Gets whether or not the database is Sybase ASE. |
boolean |
isSybase()
Gets whether or not the database is Sybase. |
void |
setProduct(java.lang.String product)
Sets the database product to the given value. |
void |
setProductFamily(java.lang.String family)
Sets the database product family to the given value. |
void |
setProductIDString(java.lang.String prodStr)
Sets the product ID string for this database. |
void |
setVersionReleaseMod(int version,
int release,
int mod)
Sets the product version, release, and mod level to the given values. |
void |
setVersionString(java.lang.String versionString)
Sets the current version string to the given string. |
java.lang.String |
toString()
Gets the content of this object as a string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_FAMILY
public static final java.lang.String DEFAULT_PRODUCT
public static final java.lang.String DEFAULT_VERSION_STRING
public static final java.lang.String FAMILY_CLOUDSCAPE
public static final java.lang.String FAMILY_DB2
public static final java.lang.String FAMILY_INFORMIX
public static final java.lang.String FAMILY_MYSQL
public static final java.lang.String FAMILY_ORACLE
public static final java.lang.String FAMILY_SQL_SERVER
public static final java.lang.String FAMILY_SYBASE
public static final java.lang.String PRODUCT_CLOUDSCAPE
public static final java.lang.String PRODUCT_DB2_EVERYPLACE
public static final java.lang.String PRODUCT_DB2_ISERIES
public static final java.lang.String PRODUCT_DB2_LUW
public static final java.lang.String PRODUCT_DB2_ZOS
public static final java.lang.String PRODUCT_DB2_VMVSE
public static final java.lang.String PRODUCT_DERBY
public static final java.lang.String PRODUCT_INFORMIX
public static final java.lang.String PRODUCT_MYSQL
public static final java.lang.String PRODUCT_ORACLE
public static final java.lang.String PRODUCT_SQL_SERVER
public static final java.lang.String PRODUCT_SYBASE_ASA
public static final java.lang.String PRODUCT_SYBASE_ASE
public static final java.lang.String ID_DB2
public static final java.lang.String ID_DB2_PREFIX
public static final java.lang.String ID_DB2_UDB
public static final java.lang.String ID_DB2_UDB_ZSERIES
public static final java.lang.String ID_AS
public static final java.lang.String ID_AS400
public static final java.lang.String ID_DB2400_SQL
public static final java.lang.String ID_DB2_UDB_AS400
public static final java.lang.String ID_DB2_UDB_ISERIES
public static final java.lang.String ID_DB2_EVERYPLACE
public static final java.lang.String ID_SQLDS
public static final java.lang.String ID_WORKSTATION
public static final java.lang.String ID_IBM_CLOUDSCAPE
public static final java.lang.String ID_APACHE_DERBY
public static final java.lang.String ID_DERBY
public static final java.lang.String ID_INFORMIX
public static final java.lang.String ID_MYSQL
public static final java.lang.String ID_ORACLE
public static final java.lang.String ID_SQL_SERVER
public static final java.lang.String ID_SYBASE_ASA
public static final java.lang.String ID_SYBASE_ASE
Constructor Detail |
---|
public DBVersionHelper()
public DBVersionHelper(java.sql.Connection conn)
conn
- the JDBC connection to use to get product and version informationpublic DBVersionHelper(ISQLEditorConnectionInfo connInfo)
ISQLEditorConnectionInfo
object.
connInfo
- the connection info object to use to get product and verions
informationpublic DBVersionHelper(Database db)
Database
object.
db
- the database object to use to get product and version informationpublic DBVersionHelper(java.lang.String versionString)
versionString
- the version string to usepublic DBVersionHelper(int version, int release, int mod)
version
- the database versionrelease
- the database releasemod
- the database mod levelpublic DBVersionHelper(java.lang.String productFamily, java.lang.String product, int version, int release, int mod)
productFamily
- the product family to setproduct
- the database product to setversion
- the database version to setrelease
- the database release to setmod
- the database mod level to setpublic DBVersionHelper(DBVersionHelper other)
toCopy
- the object to copyMethod Detail |
---|
public int getMod()
public java.lang.String getProductFamily()
public java.lang.String getProduct()
public java.lang.String getProductIDString()
public int getRelease()
public int getVersion()
public java.lang.String getVersionString()
public boolean isCloudscape()
public boolean isDB2()
public boolean isDB2_UDB()
public boolean isDB2_390()
public boolean isDB2_400()
public boolean isDB2_Everyplace()
public boolean isDB2_iSeries()
public boolean isDB2_LUW()
public boolean isDB2_VMVSE()
public boolean isDB2_zOS()
public boolean isDerby()
public boolean isInformix()
public boolean isMySQL()
public boolean isOracle()
public boolean isSQLServer()
public boolean isSybase()
public boolean isSybase_ASA()
public boolean isSybase_ASE()
public boolean isAtLeast(int version)
version
- the version to check
public boolean isAtLeast(int version, int release)
version
- the version to checkrelease
- the release to check
public boolean isAtLeast(int version, int release, int mod)
version
- the version to checkrelease
- the release to checkmod
- the mod level to check
public boolean isAtMost(int version)
version
- the version to check
public boolean isAtMost(int version, int release)
version
- the version to checkrelease
- the release to check
public boolean isAtMost(int version, int release, int mod)
version
- the version to checkrelease
- the release to checkmod
- the mod level to check
public boolean isExactly(int version)
version
- the version to check
public boolean isExactly(int version, int release)
version
- the version to checkrelease
- the release to check
public boolean isExactly(int version, int release, int mod)
version
- the version to checkrelease
- the release to checkmod
- the mod level to check
public void setProductFamily(java.lang.String family)
family
- the product family to setpublic void setProduct(java.lang.String product)
product
- the product to setpublic void setProductIDString(java.lang.String prodStr)
prodStr
- the product ID string to setpublic void setVersionString(java.lang.String versionString)
versionString
- the version string to setpublic void setVersionReleaseMod(int version, int release, int mod)
version
- the versionrelease
- the releasethe
- mod levelpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |