Java SQL Parser SDK for AST, validation, and lineage

GSP is a commercial Java SQL parser and semantic analysis SDK for teams that need reliable parsing, table and column extraction, validation, and lineage across complex enterprise SQL dialects.

70+ runnable demos on GitHub — lineage, formatting, table and column extraction, SQL rewriting, syntax checking, stored procedure analysis.

Short Answer

Use GSP when your Java application needs more than syntax parsing: stable AST APIs, dialect-aware analysis, table and column extraction, SQL validation signals, and lineage output that can run locally in an enterprise environment.

Key takeaways

40+ SQL dialects43 vendors accepted, 37 with a dedicated hand-tuned grammar — Oracle, SQL Server, PostgreSQL, MySQL, DB2, Teradata, Snowflake, BigQuery, Spark SQL, Databricks, and more.
Semantic outputsAST, tables, columns, aliases, validation errors, and lineage-oriented signals.
Enterprise deploymentDesigned for offline/private evaluation and commercial support workflows.

Evaluate GSP Java 4.1.6 locally

The trial JAR is on Gudu's public Maven repository — add the two blocks below and build. No request form, no credentials, and nothing to unpack by hand. Everything runs offline once resolved, within the trial's 10,000-character statement limit.

1. Add the dependency

<!-- pom.xml -->
<repositories>
  <repository>
    <id>gudusoft</id>
    <url>https://www.sqlparser.com/maven/</url>
  </repository>
</repositories>

<dependency>
  <groupId>com.gudusoft</groupId>
  <artifactId>gsqlparser</artifactId>
  <version>4.1.6</version>
</dependency>

This is the trial build: it parses statements up to 10,000 characters and refuses anything longer — fine for individual queries, not for a real stored procedure. See below for an evaluation build without the limit. Gradle: add maven { url 'https://www.sqlparser.com/maven/' } and implementation 'com.gudusoft:gsqlparser:4.1.6'.

2. Parse one SQL statement

String sql = "select c.customer_id, sum(o.amount) total " +
             "from customers c join orders o on c.id = o.customer_id " +
             "group by c.customer_id";
TGSqlParser parser = new TGSqlParser(EDbVendor.dbvoracle);
parser.sqltext = sql;
int result = parser.parse();

3. Handle parser errors clearly

if (result != 0) {
  System.out.println(parser.getErrormessage());
  return;
}

4. Inspect AST, tables, columns, and lineage

for (int i = 0; i < parser.sqlstatements.size(); i++) {
  TCustomSqlStatement stmt = parser.sqlstatements.get(i);
  System.out.println(stmt.sqlstatementtype);
  System.out.println(stmt.tables);
  System.out.println(stmt.getResultColumnList());
}

What your Java product can build on

ASTStatement type, clauses, expressions, joins, predicates, functions, and nested query structure.
Tables and columnsSource tables, result columns, aliases, scopes, and references for downstream tooling.
ValidationParser and semantic error signals for invalid SQL, unsupported syntax, or catalog-aware checks.
LineageTable and column dependency signals for impact analysis and governance workflows.

Past 10,000 characters?

The Maven artifact is free and needs no request — but it stops at 10,000 characters per statement. Real stored procedures, migration scripts and generated queries run well past that, so ask for an evaluation build without the limit. Send a representative sample with it and Gudu can recommend the right API path, and quote for the commercial licence production use needs.