abstract class DatabaseExtras extends Object
The goal would be to have a separate class for each type of database. These classes would then be registered with the ExtrasRegistration class and the DatabaseProperties subclass would then use the appropriate DatabaseExtras class to obtain information that varies between databases.
Modifier and Type | Field and Description |
---|---|
(package private) Hashtable<String,String> |
terms
Contains mapping of database specific terms to their code values.
|
protected String[] |
validTerms
Array containing valid codes for database specific terms.
|
Constructor and Description |
---|
DatabaseExtras()
The objects automatically register themselves when instantiated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addTerm(String key,
String value)
Add a database specific term to the list.
|
abstract String |
getDbms()
Returns database code
|
String |
getTerm(String value)
Returns a database specific term for a function.
|
String |
listAllTerms() |
protected abstract void |
setup()
Sets up database specific objects.
|
protected String[] validTerms
CURRENTTIME | Database specific term for obtaining current date and time to be used as the value of a column. |
CURRENTDATE | Database specific term for obtaining current date to be used as the value of a column. (Hour, minutes, seconds and fractional seconds set to zero) |
DATE | Data type to be used for representing dates (Hours, minutes, seconds, and fractional seconds set to zero) |
DATETIME | Data type to be used for date and time. |
DOUBLE | Data type to be used for double precision floating point values. |
FLOAT | Data type to be used for single precision floating point values. |
LONGBLOB | Data type for very long binary objects. |
LONGCLOB | Data type for very long character objects. |
public DatabaseExtras()
public abstract String getDbms()
protected abstract void setup()
protected void addTerm(String key, String value)
key
- Code for database specific termvalue
- Value of database specific termpublic String getTerm(String value)
value
- Identifier for termpublic String listAllTerms()