A production-ready, cross-platform database management application built with JavaFX 21, featuring a modern dark UI, real-time SQL syntax highlighting, async query execution, and support for MySQL and Microsoft SQL Server.
- π¨ Modern Dark UI: Nord/Dracula-inspired theme with smooth transitions
- βοΈ SQL Editor: Real-time syntax highlighting with RichTextFX
- β‘ Async Query Execution: Non-blocking queries with loading overlay
- ποΈ Schema Browser: TreeView with tables and columns
- π Dynamic Results: TableView with automatic column generation
- π Connection Pooling: HikariCP for optimal performance
- ποΈ Multi-Database: MySQL and MSSQL support
- Java 21 or higher
- Maven 3.8+
- MySQL or Microsoft SQL Server database
# Clone or navigate to the project directory
cd queryWorkerJava
# Build the project
mvn clean package
# Run the application
mvn javafx:run- Click Connect button or use
File β Connect - Select database type (MySQL or MSSQL)
- Enter connection details:
- Host (e.g.,
localhost) - Port (default: 3306 for MySQL, 1433 for MSSQL)
- Database name
- Username and password
- Host (e.g.,
- Click Connect
- Type your SQL query in the editor
- Press Ctrl+Enter or click Execute
- View results in the table below
- Check execution time in the status bar
- Expand the tree to view tables
- Click on a table to see its columns
- Use Refresh Schema to update the tree
queryWorkerJava/
βββ src/main/java/
β βββ nl/
β βββ jorisros/
β βββ queryworker/
β βββ MainApp.java # Application entry point
β βββ config/ # Dependency injection (Guice)
β β βββ AppModule.java
β βββ controller/
β β βββ MainController.java # Primary UI logic
β β βββ QueryPanelController.java # Tab-specific logic
β βββ model/
β β βββ ConnectionStore.java # Connection persistence
β β βββ DatabaseConnection.java # Connection configuration
β βββ service/
β β βββ ConnectionManager.java # HikariCP pool management
β β βββ DatabaseService.java # Async query execution
β β βββ ThemeManager.java # Theme switching logic
β β βββ git/ # Git integration
β βββ view/
β β βββ ErdView.java # ER Diagram visualizer
β β βββ SettingsDialog.java # App settings
β βββ component/
β β βββ SqlEditor.java # RichTextFX editor wrapper
β β βββ LoadingOverlay.java # Progress indicator
β βββ database/ # Database provider adapters
β βββ mysql/
β βββ mssql/
βββ src/main/resources/
β βββ application.properties
β βββ nl/
β βββ jorisros/
β βββ queryworker/
β βββ view/
β β βββ MainView.fxml # Main layout
β β βββ QueryPanel.fxml # Tab layout
β βββ styles/
β βββ dark-mode.css # Theme definitions
β βββ erd-view.css # ERD specific styles
βββ pom.xml
| Technology | Purpose |
|---|---|
| JavaFX 21 | Modern UI framework |
| RichTextFX | Advanced code editor with syntax highlighting |
| HikariCP | High-performance JDBC connection pooling |
| MySQL Connector/J | MySQL database driver |
| MSSQL JDBC Driver | Microsoft SQL Server driver |
- Syntax Highlighting: Keywords, strings, comments, numbers
- Line Numbers: Built-in line numbering
- Keyboard Shortcuts: Ctrl+Enter to execute
- Dynamic Columns: Auto-generated from ResultSetMetaData
- Virtualization: Efficient rendering for large datasets
- Row Count: Display total rows returned
- Fade Animations: Smooth show/hide transitions
- Progress Indicator: Visual feedback during query execution
Edit src/main/resources/application.properties:
hikari.maximumPoolSize=10
hikari.minimumIdle=2
hikari.connectionTimeout=30000
hikari.idleTimeout=600000
hikari.maxLifetime=1800000The application supports:
- MySQL:
jdbc:mysql://host:port/database - MSSQL:
jdbc:sqlserver://host:port;databaseName=database
# Compile only
mvn compile
# Run tests (if any)
mvn test
# Package as JAR
mvn package
# Clean build artifacts
mvn cleanmvn javafx:run -Djavafx.args="--enable-preview"-- Select all records
SELECT * FROM users LIMIT 100;
-- Join tables
SELECT o.id, c.name, o.total
FROM orders o
INNER JOIN customers c ON o.customer_id = c.id
WHERE o.status = 'completed';
-- Aggregate functions
SELECT
category,
COUNT(*) as count,
AVG(price) as avg_price
FROM products
GROUP BY category
ORDER BY count DESC;| Shortcut | Action |
|---|---|
Ctrl+Enter |
Execute query |
Ctrl+Q |
Quit application |
- Verify database is running
- Check firewall settings
- Ensure JDBC driver is compatible
- Validate credentials
- Adjust HikariCP pool size in
application.properties - Use
LIMITclause for large result sets - Enable database query caching
This project is provided as-is for educational and professional use.
- JavaFX - Modern Java UI framework
- RichTextFX - Rich text editing for JavaFX
- HikariCP - Lightning-fast connection pooling
- Nord Theme - Beautiful color palette inspiration