iiitAccessServer 1.0

de.iiit.access.server.util.db
Class PropertyTable

java.lang.Object
  |
  +--de.iiit.access.server.util.db.PropertyTable

public class PropertyTable
extends Object

Every database controlled by the cache manager will contain a property table. These table can be used like property files, they contain records with pairs of key and values. Until now they will be used only to store the number of the next cache table to create.


Method Summary
static boolean createPropertyTable(JdbcConnectionPool pool)
          Creates a new property table
static void insertProperty(JdbcConnectionPool pool, String property, String value)
          Inserts a new record into the property table
static boolean searchProperty(JdbcConnectionPool pool, String property)
          Test whether a property with a given name is there
static String selectProperty(JdbcConnectionPool pool, String property)
          Retrieves one property record
static String selectProperty(JdbcConnectionPool pool, String property, String defaultValue)
          Retrieves one property record
static void updateProperty(JdbcConnectionPool pool, String property, String value)
          Updates a record in the property table
static void writeProperty(JdbcConnectionPool pool, String property, String value)
          Writes a record into the property table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createPropertyTable

public static boolean createPropertyTable(JdbcConnectionPool pool)
                                   throws JdbcException
Creates a new property table

Parameters:
pool - The database handle to use
Returns:
true if table had to be created, false is table was already there
Throws:
JdbcException - if a JDBC error occurs

selectProperty

public static String selectProperty(JdbcConnectionPool pool,
                                    String property)
                             throws JdbcException
Retrieves one property record

Parameters:
pool - The database handle to use
property - The name of the property to search for
Returns:
the value of the property or null if no property with the given name was found.
Throws:
JdbcException - if a JDBC error occurs

selectProperty

public static String selectProperty(JdbcConnectionPool pool,
                                    String property,
                                    String defaultValue)
                             throws JdbcException
Retrieves one property record

Parameters:
pool - The database handle to use
property - The name of the property to search for
defaultValue - a default value.
Returns:
the value of the property or null if no property with the given name was found.
Throws:
JdbcException - if a JDBC error occurs

searchProperty

public static boolean searchProperty(JdbcConnectionPool pool,
                                     String property)
                              throws JdbcException
Test whether a property with a given name is there

Parameters:
pool - The database handle to use
property - The name of the property to search for
Returns:
True if the property was found, false if not.
Throws:
JdbcException - if a JDBC error occurs

insertProperty

public static void insertProperty(JdbcConnectionPool pool,
                                  String property,
                                  String value)
                           throws JdbcException
Inserts a new record into the property table

Parameters:
pool - The database handle to use
property - The name of the property
value - The value of the property
Throws:
JdbcException - if a JDBC error occurs

updateProperty

public static void updateProperty(JdbcConnectionPool pool,
                                  String property,
                                  String value)
                           throws JdbcException
Updates a record in the property table

Parameters:
pool - The database handle to use
property - The name of the property
value - The value of the property
Throws:
JdbcException - if a JDBC error occurs

writeProperty

public static void writeProperty(JdbcConnectionPool pool,
                                 String property,
                                 String value)
                          throws JdbcException
Writes a record into the property table. If a record with the given name is already there, it will be updated. Otherwise a new record will be inserted.

Parameters:
pool - The database handle to use
property - The name of the property
value - The value of the property
Throws:
JdbcException - if a JDBC error occurs

iiitAccessServer 1.0

Copyright © 2002, 2003 ingeneurbuero fuer innovative informationstechnik, Dipl.-Ing. Joerg Beckmann, Dortmund, Germany. All Rights Reserved.
See Copyright statement