Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsing and modification of SQL statements in Java

Does anyone know about a SQL statements parser, in Java, that would allow having an Object representation of a SQL query, allow modifying this representation and generate back the updated SQL statement?

Regards, Christophe

like image 302
Christophe Avatar asked Aug 20 '10 12:08

Christophe


People also ask

What is parsing in SQL?

The parsing stage involves separating the pieces of a SQL statement into a data structure that other routines can process. The database parses a statement when instructed by the application, which means that only the application, and not the database itself, can reduce the number of parses.

What is parsing a query?

Parsing of a query is the process by which this decision making is done that for a given query, calculating how many different ways there are in which the query can run. Every query must be parsed at least once. The parsing of a query is performed within the database using the Optimizer component.

What is SQL parsing in Oracle?

Parsing. This is the first step in the processing of any statement in Oracle. Parsing is the act of breaking the submitted statement down into its component parts ? determining what type of statement it is (query, DML, DDL) and performing various checks on it.

What is SQL statement in Java?

sql. Statement , interface is used to execute SQL statements against a relational database. You obtain a JDBC Statement from a JDBC Connection. Once you have a Java Statement instance you can execute either a database query or an database update with it.


1 Answers

I would think that ANTLR would be able to do this.

like image 154
Ira Baxter Avatar answered Oct 09 '22 23:10

Ira Baxter