Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / November 2007

Tip: Looking for answers? Try searching our database.

SQL query parser

Thread view: 
Boris Stumm - 30 Nov 2007 15:41 GMT
Hello all,

I am currently looking for an SQL parser written in Java, preferably
with source code. What I want to do is to infer (as far as possible)
the schema from an SQL DML statement. The parser should give me some
nice, traversable Java object tree/abstract syntax tree.

So far I only found sql4j and Zql, which both are very old and do not
parse my statements.

Anyone can give me some pointers? Here is a list of things that the
parser should be able to parse:

* CASE statements in the SELECT as well as in the WHERE clause
* subselects, exists, not exists, ...
* column and table aliasing
* grouping and aggregate functions

Thanks for your help,
Boris Stumm
Dyreatnews@sun.com - 30 Nov 2007 18:19 GMT
> Hello all,
>
[quoted text clipped - 13 lines]
> * column and table aliasing
> * grouping and aggregate functions

Derby uses javacc with an SQL grammar file which you could look at.

See http://db.apache.org/derby/dev/derby_source.html

You'll probably have to do quite a bit of tweaking to make it suit
your needs, though...

Signature

dt



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.