All Packages Class Hierarchy This Package Previous Next Index
Class examples.jdbc.DomainTable
java.lang.Object
|
+----examples.jdbc.Table
|
+----examples.jdbc.DomainTable
- public class DomainTable
- extends Table
This class provides a basic service for managing a domain table in a database.
The domain table represents a domain in the agent. Data is kept on all
m-beans registered persistent in this domain.
The domain table structure:
| Column Name |
Column Type |
| className |
VARCHAR |
| keyProperties |
VARCHAR |
| mbeanData |
BINARY |
-
BINARY_SIZE
- The byte array column size.
-
VARCHAR_SIZE
- The string column size.
-
DomainTable(Connection, String)
- Creates a
DomainTable that manipulates domain tables in the
database.
-
add(String, String, byte[])
- Adds a new row to the domain table.
-
contains(String, String)
- Tests if the row exists in the domain table.
-
delete(String, String)
- Removes existing rows from the domain table.
-
drop()
- Removes the domain table definition and all data.
-
get(String, String)
- Retrieves the array of object bytes from an existing row in the domain table.
-
getObjectNameStrings(String, String)
- Retrieve all the rows satisfying the query and return a list of string
representations of object names.
-
isEmpty()
- Tests if there is any existing rows in the domain table.
-
size()
- Determines the size of the domain table.
-
update(String, String, byte[])
- Changes data in existing rows of the domain table.
VARCHAR_SIZE
public static int VARCHAR_SIZE
- The string column size.
BINARY_SIZE
public static int BINARY_SIZE
- The byte array column size.
DomainTable
public DomainTable(Connection connection,
String domainName) throws SQLException
- Creates a
DomainTable that manipulates domain tables in the
database. If the table doesn't exist in the database, it will be created.
- Parameters:
- connection - A session with a specific database.
- domainName - The name of the domain table.
- Throws: SQLException
- A database-access error occured.
add
public void add(String className,
String propertyList,
byte objectData[]) throws SQLException
- Adds a new row to the domain table.
- Parameters:
- className - The class of object that the object represents.
- propertyList - The string representation of the list of key properties.
- objectData - The array of object bytes.
- Throws: SQLException
- A database-access error occured.
update
public void update(String className,
String propertyList,
byte objectData[]) throws SQLException
- Changes data in existing rows of the domain table.
- Parameters:
- className - The class of object that the object represents.
- propertyList - The string representation of the list of key properties.
- objectData - The array of object bytes.
- Throws: SQLException
- A database-access error occured.
delete
public void delete(String className,
String propertyList) throws SQLException
- Removes existing rows from the domain table.
- Parameters:
- className - The class of object that the object represents.
- propertyList - The string representation of the list of key properties.
- Throws: SQLException
- A database-access error occured.
get
public byte[] get(String className,
String propertyList) throws SQLException
- Retrieves the array of object bytes from an existing row in the domain table.
- Parameters:
- className - The class of object that the object represents.
- propertyList - The string representation of the list of key properties.
- Returns:
- The array of object bytes.
- Throws: SQLException
- A database-access error occured.
contains
public boolean contains(String className,
String propertyList) throws SQLException
- Tests if the row exists in the domain table.
- Parameters:
- className - The class of object that the object represents.
- propertyList - The string representation of the list of key properties.
- Returns:
- True if the row exists in the domain table, else false.
- Throws: SQLException
- A database-access error occured.
getObjectNameStrings
public Vector getObjectNameStrings(String className,
String propertyList) throws SQLException
- Retrieve all the rows satisfying the query and return a list of string
representations of object names.
- Parameters:
- className - The class of object that the object represents.
- propertyList - The string representation of the list of key properties.
- Returns:
- List of object name string representations.
- Throws: SQLException
- A database-access error occured.
size
public int size() throws SQLException
- Determines the size of the domain table.
- Returns:
- The number of existing rows in the domain table.
- Throws: SQLException
- A database-access error occured.
isEmpty
public boolean isEmpty() throws SQLException
- Tests if there is any existing rows in the domain table.
- Returns:
- True if there are no existing rows in the domain table, else false.
- Throws: SQLException
- A database-access error occured.
drop
public void drop() throws SQLException
- Removes the domain table definition and all data.
- Throws: SQLException
- A database-access error occured.
All Packages Class Hierarchy This Package Previous Next Index