Skip to main content
1

Prerequisites

Before you begin, ensure you have the following installed:Java Development Kit (JDK) 8 or laterVerify your Java installation:
java -version
javac -version
You should see output indicating JDK version 8 or higher.
This project uses Java Swing for the GUI and JDBC for database connectivity, both of which are included in the standard JDK.
MySQL ServerThe application requires a MySQL server instance to connect to. Install MySQL Server 5.7 or later:
  • Download from mysql.com
  • Or install via package manager (apt, brew, etc.)
Recommended IDEWhile you can use any text editor, we recommend:
  • IntelliJ IDEA (Community or Ultimate)
  • Eclipse IDE for Java Developers
  • Visual Studio Code with Java extensions
2

Clone the Repository

Clone the project repository to your local machine:
git clone <repository-url>
cd mysql-sql-editor
Replace <repository-url> with your actual repository URL.
3

Project Structure Overview

Familiarize yourself with the project structure:
mysql-sql-editor/
├── src/                    # Source code directory
│   └── com/
│       └── app/
│           ├── Main.java              # Application entry point
│           ├── Controller/
│           │   └── Controller.java    # MVC Controller
│           ├── Model/
│           │   └── Model.java         # Database logic
│           └── View/
│               ├── View.java          # Login view
│               └── SqlEditorView.java # SQL editor view
├── lib/                    # External libraries
│   └── mysql-connector-j-9.2.0.jar
└── doc/                    # Documentation
Key Directories:
  • src/ - All Java source files organized by package (com.app)
  • lib/ - Contains MySQL Connector/J JDBC driver
  • doc/ - Project documentation and resources
Architecture:The application follows the Model-View-Controller (MVC) pattern:
  • Model (Model.java) - Database connection and query execution
  • View (View.java, SqlEditorView.java) - User interface components
  • Controller (Controller.java) - Connects model and views, handles events
4

Configure Your IDE

  1. Open IntelliJ IDEA and select File → Open
  2. Navigate to the project directory and click OK
  3. IntelliJ should automatically detect the Java project structure
  4. Add the MySQL JDBC driver to the project:
    • Go to File → Project Structure → Libraries
    • Click +Java
    • Navigate to lib/mysql-connector-j-9.2.0.jar and select it
    • Click OK to add it to the project
  5. Configure the JDK:
    • Go to File → Project Structure → Project
    • Set Project SDK to JDK 8 or later
    • Set Project language level to 8 or later
  6. Mark src as the Sources Root if not already marked (right-click → Mark Directory as → Sources Root)
IntelliJ IDEA provides excellent support for Java projects with automatic code completion, debugging, and refactoring tools.
5

Verify Setup

Test that your environment is correctly configured:
  1. Compile the project (from the project root):
    javac -cp "lib/mysql-connector-j-9.2.0.jar" -d bin src/com/app/**/*.java src/com/app/*.java
    
  2. If compilation succeeds without errors, your setup is complete!
On Windows, use semicolons (;) instead of colons (:) as the classpath separator:
javac -cp "lib/mysql-connector-j-9.2.0.jar" -d bin src/com/app/**/*.java src/com/app/*.java
For detailed build instructions, see the Building guide.

Next Steps

Now that your development environment is set up:

Troubleshooting

Java version issues If you encounter errors related to Java version compatibility:
  • Ensure you’re using JDK 8 or later
  • Check your JAVA_HOME environment variable
  • Verify your IDE is using the correct JDK version
Classpath issues If you see ClassNotFoundException for MySQL driver classes:
  • Verify mysql-connector-j-9.2.0.jar is in the lib/ directory
  • Ensure the JAR is properly added to your IDE’s build path or classpath
  • Check that the -cp flag includes the correct path to the JAR
IDE not recognizing source files
  • Mark the src directory as a source root in your IDE
  • Refresh or reload the project
  • Check that the package structure matches the directory structure (com/app)

Build docs developers (and LLMs) love