GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lyBigdata/JSqlParser: JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

1,836 Commits
1,836 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
config
config
 
 
gradle/wrapper
gradle/wrapper
 
 
src
src
 
 
.codacy.yml
.codacy.yml
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE_APACHEV2
LICENSE_APACHEV2
 
 
LICENSE_LGPLV21
LICENSE_LGPLV21
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
nb-configuration.xml
nb-configuration.xml
 
 
nbactions.xml
nbactions.xml
 
 
pom.xml
pom.xml
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

JSqlParser (4.6 Stable or 4.7 Snapshot) drawing

Build Status

Build Status (Legacy) Coverage Status Codacy Badge Maven Central Javadocs

Gitter

Summary

Please visit the WebSite. JSqlParser is a RDBMS agnostic SQL statement parser. It translates SQL statements into a traversable hierarchy of Java classes (see Samples):

SELECT 1 FROM dual WHERE a = b
 SQL Text
  └─Statements: net.sf.jsqlparser.statement.select.Select
     └─selectBody: net.sf.jsqlparser.statement.select.PlainSelect
        ├─selectItems -> Collection<SelectExpressionItem>
        │  └─selectItems: net.sf.jsqlparser.statement.select.SelectExpressionItem
        │     └─LongValue: 1
        ├─Table: dual
        └─where: net.sf.jsqlparser.expression.operators.relational.EqualsTo
           ├─Column: a
           └─Column: b
Statement statement = CCJSqlParserUtil.parse(sqlStr);
if (statement instanceof Select) {
    Select select = (Select) statement;
    PlainSelect plainSelect = (PlainSelect) select.getSelectBody();

    SelectExpressionItem selectExpressionItem =
            (SelectExpressionItem) plainSelect.getSelectItems().get(0);

    Table table = (Table) plainSelect.getFromItem();

    EqualsTo equalsTo = (EqualsTo) plainSelect.getWhere();
    Column a = (Column) equalsTo.getLeftExpression();
    Column b = (Column) equalsTo.getRightExpression();
}

Supported Grammar and Syntax

JSqlParser aims to support the SQL standard as well as all major RDBMS. Any missing syntax or features can be added on demand.

RDBMS Statements
Oracle
MS SQL Server and Sybase
PostgreSQL
MySQL and MariaDB
DB2
H2 and HSQLDB and Derby
SQLite
SELECT
INSERT, UPDATE, UPSERT, MERGE
DELETE, TRUNCATE TABLE
CREATE ..., ALTER ...., DROP ...
WITH ...

JSqlParser can also be used to create SQL Statements from Java Code with a fluent API (see Samples).

Alternatives to JSqlParser?

General SQL Parser looks pretty good, with extended SQL syntax (like PL/SQL and T-SQL) and java + .NET APIs. The tool is commercial (license available online), with a free download option.

Documentation

Samples

Build Instructions

Contribution

Change Log

Issues

License

JSqlParser is dual licensed under LGPL V2.1 or Apache Software License, Version 2.0.

About

JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern

github.com/JSQLParser/JSqlParser/wiki

Resources

Readme
License
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.