Provides "Sav Zigzag" ORDBMS for executing Zigzag (Z) language scripts from Java(tm). Zigzag algebraic expressions reflect peculiarities of ORDBMS, for example, multi-level hierarchy, many-valued data, class inheritance and manipulation of XML data with dynamic structure. The advantage of Sav Zigzag is displayed in the high speed of the processing complexly structured hierarchy data. Expressions in Zigzag language help to select such data instantly.
The Java/Zigzag program connects with local databases via Session's
exploreBase(...) and modifyBase(...) methods. These methods may be used to create
own database server working under one JVM in multiuser regime. There are no need
for special transaction and rollback. It differs from connection through JDBC
drivers. The exploreBase
permits to read data for
the current and any other parallel threads. The modifyBase
permits
to write data by only current thread, all other are locked.
The {@link sav.z.Session} is a main class needed to execute Zigzag expressions. Following example demonstrates a case of the data selection in the variable $x via Session's method z(...).
Session ss = new Session(); ss.exploreBase("company"); ss.z("$x = department:(order:(date:2006-07-19))");
To navigate through the objects in a few databases simultaneously, the {@link sav.z.Variable} and {@link sav.z.Base} objects are used. They are very useful for any consistent data processing. Following example is based on the example before. It illustrates iteration over the values of $x Variable and direct reading their "profile" attribute from the current Base.
Variable var = ss.var("x"); Base base = ss.base(); for (String department = var.first(); department != null; department = var.next()) { String profile = base.attrValue(department, "profile"); System.out.println(department + "; " + profile); }