Verhogen
Verhogen

Reputation: 28611

Java SQL comprehension

Are there Java classes for manipulating SQL statements?

For example, break this statement

SELECT col1, col2 FROM table WHERE a = 1 AND b = 2 ORDER BY 1;

into some kind of map.

['select' => {'col1', 'col2'}, 'from' => {'table'}, 'where' => ..]

Then, you would be able to say add to the where clause or add tables to select from. Is this possible?

Upvotes: 0

Views: 117

Answers (2)

Thomas Jung
Thomas Jung

Reputation: 33092

You could use squiggle-sql. It's API is object oriented but you could map it.

Upvotes: 1

Benjamin Cox
Benjamin Cox

Reputation: 6120

This may help: zql

Upvotes: 1

Related Questions