Class PropertyDB |
Provide an API for storing and retreving properties from an SQL database via ODBC. Uses methods in the PropertyUtil class (or a subclass) to obtain SQL statements for accessing the table. The methods in PropertyUtil class itself are known to work with PostgreSQL 9.6+ but some may need to be overridden for other SQL database implementations. Normally, this class is used internally with Property database access gained through the Property class.
Details |
Constructor |
PropertyDB(user, passwd:"", dsn, tabl:"property_table", utilsName:"propertydb::PropertyUtil")
user | name of user owning the database table |
passwd | that user's database access password (defaults to "") |
dsn | database name as known by ODBC |
Create class instance. <[/p>
Methods: |
Remove all properties from the database
pName | name of the desired property |
property value as a JSON string |
if property isn't stored in database |
Produce the value of a property.
table of properties |
Produce a table containing all of the stored properties. The table is keyed by property name and each property value is represented as a JSON string.
set of all property names |
Produce a set of all property names in the table.
pName | name of property to remove |
Remove a property from the database
pName | name of the property |
pValue | value of the property as a JSON string |
Store a property into the database
switchPropertyTable(tableName)
tableName | name of property table to use |
Switch to a different property table in the database. Reference properties in a different table. The table must be (and will be created there if not) in the same SQL database as the original.
Fields: |