|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.jdbc.JDBCObjectManager
public class JDBCObjectManager
This is the JDBC implementation of IObjectManager. Object types are stored as tables in a SQL database, their data represented by table schemas which allow for fast and convenient access to data.
| Field Summary | |
|---|---|
protected java.util.Hashtable |
typesTable
|
protected java.sql.PreparedStatement |
updateUniqueIDStmt
|
| Fields inherited from interface com.cometway.om.IObjectManager |
|---|
LIST_SUPPORTED_TYPES, LIST_TYPES |
| Constructor Summary | |
|---|---|
JDBCObjectManager(java.lang.String jdbcDriver,
java.lang.String jdbcURL,
java.lang.String user,
java.lang.String password)
Creates a new instance of this object manager and connects to a database using the supplied parameters. |
|
| Method Summary | |
|---|---|
boolean |
changeObjectID(ObjectID oldID,
ObjectID newID)
Changes the objectID of an object. |
ObjectID |
createObject(ObjectType type)
Creates a new object in the object manager of the specified object type. |
protected void |
debug(java.lang.String methodName,
java.lang.String message)
Called internally to output debugging information to the System.out stream. |
protected void |
error(java.lang.String methodName,
java.lang.String message,
java.lang.Exception e)
Called internally to output error messages to the System.err stream. |
protected void |
finalize()
Called by the garbage collector; close prepared statements. |
java.lang.Object |
getObject(ObjectID id)
Retrieves the object corresponding to an object ID. |
java.lang.String |
getStatus()
Returns a string containing current status information about this object manager. |
java.util.Vector |
listObjects(java.lang.Object objectQuery)
Returns a Vector of objects designated by the objectQuery parameter. |
boolean |
removeObject(ObjectID id)
Deletes the object corresponding to an object ID from the object manager. |
void |
setDebug(boolean state)
Enables debugging messages that are printed to the System.out stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Hashtable typesTable
protected java.sql.PreparedStatement updateUniqueIDStmt
| Constructor Detail |
|---|
public JDBCObjectManager(java.lang.String jdbcDriver,
java.lang.String jdbcURL,
java.lang.String user,
java.lang.String password)
jdbcDriver - the class name of the JDBC driver to use for this connection (ie: "sun.jdbc.odbc.JdbcOdbcDriver").jdbcURL - the connection URL for this driver and database (ie: "jdbc:odbc:database").user - the account username used to access the database.password - the account password used to access the database.| Method Detail |
|---|
public ObjectID createObject(ObjectType type)
Note: Currently, only the PropsType is supported.
createObject in interface IObjectManagertype - a reference to an ObjectType representing the type of object to create.
protected void debug(java.lang.String methodName,
java.lang.String message)
protected void error(java.lang.String methodName,
java.lang.String message,
java.lang.Exception e)
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic java.lang.Object getObject(ObjectID id)
getObject in interface IObjectManagerid - a reference to an ObjectID representing a valid object in the object manager.
public java.lang.String getStatus()
public java.util.Vector listObjects(java.lang.Object objectQuery)
| IObjectManager.LIST_TYPES | Lists object types that already exist. |
| IObjectManager.LIST_SUPPORTED_TYPES | Lists objects which can be passed to createObject. |
| ObjectType | Lists all existing objects of the same ObjectType. |
| PropsQuery | Lists Props based on data from the PropsQuery object. |
listObjects in interface IObjectManagerobjectQuery - any valid object from the list above.
public boolean removeObject(ObjectID id)
removeObject in interface IObjectManagerid - a reference to an ObjectID representing a valid object in the object manager.
public void setDebug(boolean state)
state - true enables debugging; false disables it.
public boolean changeObjectID(ObjectID oldID,
ObjectID newID)
changeObjectID in interface IObjectManager
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||