public abstract class AbstractDatabaseParameter extends AbstractParameter
GenericSql object, which connects on init. Each query
to the parameter via the get() and set(java.lang.Object) method first checks if
the connections is open, if it was closed unexpectedely and the
KEY_ALLOWREOPEN property points to true, its is opened again. If
successful, the abstract methods getFromOpenDatabase(mysql.SqlAccess) or
setIntoOpenDatabase(mysql.SqlAccess, java.lang.Object) methods are called.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private SqlAccess |
db
My SQL instance.
|
private static boolean |
DEFALLOWREOPEN
The key to the unique trigger name.
|
static String |
KEY_ALLOWREOPEN
The key to the unique trigger name.
|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDatabaseParameter(Map<String,String> prop)
Constructs a new database parameter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
exit()
On exit, we close the database, if we are open.
|
Object |
get()
Gets the parameter from the database.
|
protected abstract Object |
getFromOpenDatabase(SqlAccess db)
This method is called if the database is ready for data retrieval.
|
void |
init()
Initializes the database and tries to open it.
|
Object |
set(Object to)
Sets the parameter from the database.
|
protected abstract Object |
setIntoOpenDatabase(SqlAccess db,
Object to)
This method is calles if the database is ready to insert a new value.
|
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, overrideDefaultName, register, rescanned, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringPropertiespublic static final String KEY_ALLOWREOPEN
private static final boolean DEFALLOWREOPEN
private SqlAccess db
public void init()
throws InitException
init in interface Initializableinit in class AbstractParameterInitExceptionpublic void exit()
exit in interface ExitCleaningexit in class AbstractParameterpublic Object get()
KEY_ALLOWREOPEN property
points to true, we reopen.public Object set(Object to)
KEY_ALLOWREOPEN property
points to true, we reopen.protected abstract Object getFromOpenDatabase(SqlAccess db) throws SQLException
SQLExceptionprotected abstract Object setIntoOpenDatabase(SqlAccess db, Object to) throws SQLException
SQLException