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,695
  • 6
  • 54
  • 72

1 Answers1

2

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

Blindy
  • 65,249
  • 10
  • 91
  • 131