Structure of the input request The outermost tags bounding an input request must be and . The complete request consists of two main parts, as shown below: Connection-parameters Action The Connection-parameters section has to be bounded by the tags and , and must contain all of the following 4 data items, in the given order. The values have to be specified as strings (i.e. enclosed within double-quotes). i. the vendor name ii. the URL for the database iii. the userid for connecting to the database, and iv. the password for connecting to the database The vendor name must already be included in the class-dictionary. The JDBC driver and SQL statement formats also must be specified in the class-dictionary. A sample entry is given below: "generic" "jdbc:odbc:xmldb" "anonymous" "guest" In this example, the name of the vendor is "generic", the URL for the database is "jdbc:odbc:xmldb", and the userid/password to be used for connecting to the database is "anonymous" and "guest". The vendor name is just a logical name for grouping a set of SQL statement formats and associating a JDBC driver to the group. It doesn't have to correspond to real-world vendor names. The Action part may specify a Query or an Insert. A Query has several parts and has the following structure: TableName1
ColumnName1,1 : ColumnDataType1,1 ... ColumnName1,m : ColumnDataType1,m [ TableName2
ColumnName2,1 : ColumnDataType2,1 ... ColumnName2,n : ColumnDataType2,n ] [ Condition ] [ [ Tablenamex
] Columnx ... [ Tablenamey
] Columny
] [ [ ParentTable
] ParentColumn
[ ChildTable
] ChildColumn
RelationColumn
]
The only mandatory data item in a query specification is the first table name and its associated columns. Everything else (shown enclosed within [ and ] above) is optional. At most two tables, and any number of columns belonging to the tables may be specified in the query request. The currently recognized column data types are Integer, Float and Text. These values must be specified exactly like this, and must not be enclosed within double-quotes. All other data items in this section must be enclosed within double quotes. The table names in the Order section, and the Parent, Child sections under ShowHierarchy are optional and may be omitted if the corresponding column name is unambiguous. The Condition section is used to specify a condition string which may actually consist of any number of atomic conditions connected by and/or and parentheses. Any double quote in the condition string should be replaced by a single quote, for correct parsing of the input. The Order section can be used to mention a list of columns by which the resultset is to be ordered. The ShowHierarchy section can be used to transform a linear resultset obtained directly from a database into a hierarchical form. It can be used to achieve transitive closure using two columns (e.g. employee-id and manager-id in the employee table) in the same table, or to create an inner join using two columns belonging to two different tables. The column corresponding to the enclosing entity (e.g. manager) is to be specified as the Parent, while the other column (e.g. a subordinate employee) must be specified as the Child. The name of the virtual column (obviously belonging to the parent entity) that represents the one-to-many relationship between the parent and the child (e.g. manages) is specified as the RelationColumn. An Insert specification is simpler and consists of the following parts: TableName
ColumnName1 : ColumnDataType1 ColumnValue1 ... ColumnNamen : ColumnDataTypen ColumnValuen
Only one table (but any number of columns belonging to that table) can be specified in an insert request. A value corresponding to each column must also be specified. As in the case of query requests, all data items (except for the column data type) must be given as a string (i.e. enclosed within double quotes). Even if a column value is intended to be of a numeric data type, it must be specified as a string, but the column data type specification should reflect the appropriate type (Integer or Float for numeric values, and Text for textual values including dates). The table and column names must all be already defined in the class-dictionary, otherwise the request will not be accepted. As in XML, there is no restriction about including white space around the tags and data values.