mysql
Class AbstractSql

java.lang.Object
  extended by util.PropertyContainer
      extended by mysql.AbstractSql
All Implemented Interfaces:
Cloneable, Initializable, PropertyBearing
Direct Known Subclasses:
HistorySql, NightlyStatistic, ObserveSql, PermissionSql, ProposalSql, Statistics, TargetDatabase, TargetSql, TaskSql, UserSql, WeatherSql

public abstract class AbstractSql
extends PropertyContainer

Base class for database-accessors using the StaticSql connection manager. Provides fields for individual user names and password, as well as the table name.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
static String KEY_PASSWORD
          The key to the password for db-acces if not default.
static String KEY_TABLE
          The key to the table name where star data is stored.
static String KEY_USERNAME
          The key to the user name for db-acces if not default.
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
protected AbstractSql(Map<String,String> prop)
          Constructs a new abstract sql database.
 
Method Summary
 String getPassword()
          Returns the passwort
 String getTable()
          Returns the table name.
 String getUserName()
          Returns the user-name property or null if not specified.
 void init()
          If we are not the default user of the database, try to add ourself here.
 boolean isEntry(String where)
          Returns true, if this where clause returns a non-empty result set.
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, isNew, keyCreate, keyCreate, parseObject, reload, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_USERNAME

public static final String KEY_USERNAME
The key to the user name for db-acces if not default.

See Also:
Constant Field Values

KEY_PASSWORD

public static final String KEY_PASSWORD
The key to the password for db-acces if not default.

See Also:
Constant Field Values

KEY_TABLE

public static final String KEY_TABLE
The key to the table name where star data is stored.

See Also:
Constant Field Values
Constructor Detail

AbstractSql

protected AbstractSql(Map<String,String> prop)
Constructs a new abstract sql database.

Method Detail

init

public void init()
If we are not the default user of the database, try to add ourself here.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyContainer

getUserName

public String getUserName()
Returns the user-name property or null if not specified.


getPassword

public String getPassword()
Returns the passwort


getTable

public String getTable()
Returns the table name.


isEntry

public boolean isEntry(String where)
                throws SQLException,
                       ConnectException
Returns true, if this where clause returns a non-empty result set.

Throws:
SQLException
ConnectException