1

What (tool, library, way) can you recommend for parsing SQL query in Java?
I need to change column names in output, so for example:
I want to change query from:

SELECT a AS one, b AS two FROM xyz ORDER BY 1

to

SELECT a AS one_1, b AS two_2 FROM xyz ORDER BY 1

There might be many queries in one file to parse.

I tried using JSqlParser, but it doesn't support UTF-8 in SQL statements.

wlk
  • 5,567
  • 6
  • 53
  • 72

1 Answers1

2

JSqlParser comes to mind. Never used it, but seems to fit the bill pretty well.

Blindy
  • 60,429
  • 9
  • 84
  • 123