This package provides JDBC wrappers to a DBDOM database. DBDOM is an implementation of W3C DOM in SQL on top of a relational database. For more information on DBDOM, see http://www.iter.co.il.

This package provides classes that implement interfaces in package {@link org.w3c.dom} for the convenience of Java developers who use DBDOM.

Classes in this package can be used as a drop-in replacement in any application that expects a DOM object.

To use this package, open a JDBC {@link java.sql.Connection} to a DBDOM database and pass it to the constructor of {@link il.co.iter.dbdom.DBDOMImplementation}.

Design Notes:

Many objeccts are kept in {@link il.co.iter.dbdom.DBDOMImplementation} as dynamic private members, where one might expect static members in other classes. This is because diffrent instances of {@link il.co.iter.dbdom.DBDOMImplementation} may hold connections to different databases - with different {@link java.sql.Connection} objects and possibly different versions of DBDOM and possibly different RDBMSs altogether.

Implementation notes:

The current JDBC wrappers take a simplistic approach to caching and locking. They are just that - wrappers. All 'real' work occures in the database, in its stored procedures.

In particular,

Throwing {@link org.w3c.dom.DOMException#INVALID_STATE_ERR} is not implemented yet.

Error checking:

In genreal, the database is responsible for error checking. Java wrappers pass their arguments 'as is' to stored procedures that are expected to perform all relevant validation. This is consistent with the concept of wrappers.

However, certain issues are beyond the database's control. For instance, the database cannot know if a node that the client refers to is from the same databes or a different one. Consider two DBDOM databases that both have Document nodes with id 123. If one receives a request to appendChild() where both parent and cild nodes' ownerDocument's id is 123 but the nodes are from different databases, it will honor the request, since it has no way to check for this. The wrapper is, therefore, expected to compare two Nodes' connectionStrings and throw {@link org.w3c.dom.DOMException#WRONG_DOCUMENT_ERR} if necessary before invoking stored procedures. The wrapper also checks that a Node's Implementation is DBDOMImolementation. This is accomplished rather trivially, through catching ClassCastException: if a {@link org.w3c.dom.Node} cannot be cast to {@link il.co.iter.dbdom.DBNode}, there is no id to go by.

Note that apart from casting exceptions, {@link org.w3c.dom.DOMException#WRONG_DOCUMENT_ERR} cheking is not currently implemented in the wrappers or, only in the database.