Class PropertyDB

Summary

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.

Superclasses:
Object

Package:
propertydb
File:
propertydb.icn
Methods:
clearAll, fetch, fetchAll, fetchAllNames, removeProperty, store, switchPropertyTable

Methods inherited from Object:
Type, className, clone, equals, fieldNames, genMethods, getField, get_class, get_class_name, get_id, hasField, hasMethod, hash_code, instanceOf, invoke, is_instance, setField, to_string

Fields:
db, utils

Source code.

Details
Constructor

PropertyDB(user, passwd:"", dsn, tabl:"property_table", utilsName:"propertydb::PropertyUtil")

Parameters:
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:

clearAll()

Remove all properties from the database


fetch(pName)

Parameter:
pName
name of the desired property
Returns:
property value as a JSON string
Fails:
if property isn't stored in database

Produce the value of a property.


fetchAll()

Returns:
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.


fetchAllNames()

Returns:
set of all property names

Produce a set of all property names in the table.


removeProperty(pName)

Parameter:
pName
name of property to remove

Remove a property from the database


store(pName, pValue)

Parameters:
pName
name of the property
pValue
value of the property as a JSON string

Store a property into the database


switchPropertyTable(tableName)

Parameter:
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:
db

utils


This page produced by UniDoc on 2021/04/15 @ 23:59:53.