JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
SELECT TOP (? + 1) * FROM MyTable
SELECT * FROM mytable WHERE mytable.boolValue;
UPDATE tablename SET ... ORDER BY col;
UPDATE tablename SET ... ORDER BY col LIMIT 10;
UPDATE table1 A SET ... LIMIT 10;
DELETE FROM tablename LIMIT 5;
DELETE FROM tablename ORDER BY col;
DELETE FROM tablename ORDER BY col LIMIT 10;
select '\''
SELECT * FROM mytable WHERE -? < 4
SELECT * FROM t1 WHERE ROW(col1, col2) = (SELECT col3, col4 FROM t2 WHERE id = 10)
GROUP_CONCAT(DISTINCT test_score ORDER BY test_score DESC SEPARATOR ' ')
KEEP (DENSE_RANK FIRST ORDER BY col1)
WITH RECURSIVE data as (SELECT ...) ...
.. WHERE a( + ) = b
SELECT a FROM b WHERE c = :1
SELECT @col FROM table1
SELECT LISTAGG(col1, '##') WITHIN GROUP (ORDER BY col1) FROM table1
SELECT * FROM (WITH actor AS (SELECT 'a' aid FROM DUAL) SELECT aid FROM actor)
SELECT * FROM mytable WHERE COL1 = lines(idx).field1
SELECT * FROM user_table FOR UPDATE
UPDATE mytable SET (col) = (SELECT a FROM mytable2)
EXECUTE myproc 'a', 2, 'b'
SELECT * INTO mytable FROM mytable2
INSERT INTO mytable (mycolumn) WITH a AS (SELECT mycolumn FROM mytable) SELECT mycolumn FROM a
limit 0
and limit null
clause.CREATE TABLE table1 as SELECT col1, col2 FROM table2
SELECT data->'images'->'thumbnail'->'url' AS thumb FROM instagram
INSERT INTO mytable (mycolumn) VALUES ('1') RETURNING id
UPDATE table1, table2 SET table1.col2 = table2.col2, table2.col3 = 'UPDATED' WHERE table1.col1 = table2.col1
SELECT cast, do FROM tableName
SELECT * FROM (SELECT times_purchased, state_code FROM customers t) PIVOT (count(state_code) FOR state_code IN ('NY', 'CT')) ORDER BY times_purchased
CAST(col2 AS CHAR(255) CHARACTER SET utf8)
SELECT +col, -col FROM mytable
Expression expr = CCJSqlParserUtil.parseExpression("a*(5+mycolumn)");
Select select = SelectUtils.buildSelectFromTable(new Table("mytable"));
SELECT * FROM mytable myalias
ALTER TABLE mytable ADD COLUMN mycolumn varchar (255)
SELECT a, b FROM foo WHERE a ~ '[help].*';
SELECT a, b FROM foo WHERE a ~* '[help].*';
SELECT a, b FROM foo WHERE a !~ '[help].*';
SELECT a, b FROM foo WHERE a !~* '[help].*';