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.

2

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.