Quick Start¶
Get up and running with General SQL Parser in just a few minutes! This guide will walk you through installation, basic setup, and your first SQL parsing example.
Prerequisites¶
- Java 8 or higher (Java 11+ recommended)
- Maven or Gradle for dependency management
- IDE (IntelliJ IDEA, Eclipse, or VS Code recommended)
Installation¶
- Download the trial version JAR file from our website
- Extract the downloaded ZIP file (e.g.,
gudusoft.gsqlparser.trial.3.0.9.0.zip
) - Navigate to the extracted directory containing the JAR file (e.g.,
gsqlparser-3.0.9.0.jar
)
Maven¶
- Install the JAR into your local Maven repository using one of the
mvn install:install-file
commands shown below
1 2 3 4 5 6 |
|
1 2 3 4 5 6 |
|
- The installed JAR file will be located in your local Maven repository, typically at:
JAR file location
- Linux/macOS:
~/.m2/repository/gudusoft/gsqlparser/3.0.9.0/
- Windows:
C:\Users\<username>\.m2\repository\gudusoft\gsqlparser\3.0.9.0\
Version Number
Please replace the version number "3.0.9.0" in the commands above with the actual version number of General SQL Parser Java that you downloaded from www.sqlparser.com. The version number can be found in the downloaded ZIP file name or JAR file name.
- Add the General SQL Parser dependency to your
pom.xml
:
1 2 3 4 5 |
|
-
Navigate to your project directory containing
pom.xml
and compile the project:1
mvn compile
-
To run your program, you'll need to configure the main class in your
pom.xml
. Add this plugin configuration:Then run:1 2 3 4 5 6 7 8 9 10 11 12
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>3.1.0</version> <configuration> <mainClass>GSPDemo</mainClass> </configuration> </plugin> </plugins> </build>
1
mvn exec:java
Manual Installation¶
- Download the JAR file from our website
- Add it to your project's classpath
- Include any required dependencies
Your First SQL Parser¶
Let's create a simple example that parses a SQL statement:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
Expected Output¶
1 2 3 |
|
Database Vendor Support¶
General SQL Parser supports 30+ database vendors. Here are some common examples:
1 2 |
|
1 2 |
|
1 2 |
|
1 2 |
|
1 2 |
|
Common Use Cases¶
1. SQL Validation¶
1 2 3 4 5 |
|
2. Extract Table Names¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
3. Format SQL¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
Error Handling¶
Always handle parsing errors gracefully:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Next Steps¶
Now that you have General SQL Parser running, explore these areas:
Continue Learning
- Getting Started with GSP - Comprehensive tutorial
- Basic SQL Parsing - Learn parsing fundamentals
- Working with Different Databases - Multi-vendor support
- Performance Optimization - Speed up your parsing
- Error Handling - Robust error management
- Parse Oracle PL/SQL - Advanced Oracle features
- API Documentation - Complete API reference
- SQL Syntax Support - Supported SQL features
- Configuration Options - Parser configuration
Troubleshooting¶
Common Issues¶
Parse Error: Unexpected token
Solution: Check that you're using the correct database vendor. SQL syntax varies between databases.
1 2 3 4 5 6 7 |
|
ClassNotFoundException
Solution: Ensure the GSQLParser JAR is in your classpath and all dependencies are included.
OutOfMemoryError
Solution: For large SQL files, consider parsing statements individually or increase JVM heap size.
Getting Help¶
- 📖 Check our FAQ for common questions
- 💬 Visit our Support page for community help
- 📧 Contact technical support for commercial licenses
Ready for more advanced features? Continue with our comprehensive tutorials or explore specific how-to guides.