分类: LINUX
2009-03-25 15:42:47
Zql can parse all the queries given as examples in the following (downloaded from ).
See the Zql API documentation for more info about the Zql structures.
A SQL expression evaluator comes with Zql, so you can easily evaluate
SQL expressions out of the parser.
for any bug report or suggestion.
tar xvf Zql.tar
(or use WinZip if you are a Windows user).
java Zql.ZqlParser
, then some SQL statements (like
select * from customer;
) to make sure Zql is properly installed.
Note that java sources are NOT provided in the package, but you can
concerning the availability, licensing terms and conditions.
It takes as input SQL statements (select, insert, update, delete, commit, rollback, set transaction), and fills in Java structures that represent the statements it parsed.
Example:
SELECT ANTIQUEOWNERS.OWNERLASTNAME, ANTIQUEOWNERS.OWNERFIRSTNAME
FROM ANTIQUEOWNERS, ANTIQUES
WHERE ANTIQUES.BUYERID = ANTIQUEOWNERS.OWNERID AND ANTIQUES.ITEM = 'Chair';
Will result in a ZqlQuery structure.
ZqlQuery's getSelect(), getFrom() and getWhere() methods will extract the
SELECT, FROM and WHERE parts of the query.
SELECT a+b FROM num;
).ANTIQUES.BUYERID = ANTIQUEOWNERS.OWNERID AND ANTIQUES.ITEM = 'Chair'
in the example above (the expression evaluator that comes with
Zql can evaluate such expressions, for a given data tuple).