JSqlParser is a SQL parser for the JVM that converts SQL statements into a traversable hierarchy of Java objects and back again.
The tool solves the problem of programmatically analyzing and manipulating SQL across different database systems. It parses any SQL statement into an abstract syntax tree represented as Java classes, which can be navigated and modified using the Visitor pattern. The same object model works bidirectionally: you can build SQL statements from Java using a fluent API and render them back as SQL text.
JSqlParser targets the SQL standard plus all major RDBMS dialects—BigQuery, Snowflake, DuckDB, Redshift, Oracle, MS SQL Server, Sybase, PostgreSQL, MySQL, MariaDB, DB2, H2, HSQLDB, Derby, and SQLite—using a single grammar rather than dialect-specific extensions. This makes it suitable for applications that need to work with SQL from multiple database systems without maintaining separate parsers. The tool is RDBMS-agnostic and adds missing syntax on demand through issue reporting. Developers should use the Manticore builds, which are released continuously and incorporate recent performance and grammar improvements; the upstream release on Maven Central is considerably older.
The project demonstrates sustained performance optimization work, having achieved significant speed improvements over earlier versions and outperforming other SQL parsers on real-world SQL benchmarks. Development activity includes active grammar expansion to support additional SQL syntax across supported dialects, with a documented contribution process for adding missing features.