Java MySQL SQL Client
An academic Java desktop application that connects directly to MySQL through JDBC, lets users execute SQL commands, and dynamically renders query results in a Swing interface.

Overview
The Java MySQL SQL Client is a two-tier client-server application I developed for a database programming project.
The application provides a desktop interface for connecting directly to a MySQL database, entering SQL commands, executing queries or updates, and viewing database results without using the MySQL command-line interface.
My work focused on the Java client, JDBC database connectivity, event-driven Swing interface, and a reusable table model capable of displaying result sets with different structures.
Problem / Motivation
Working directly with SQL through a terminal is useful, but it does not demonstrate how a real application communicates with a relational database.
The goal of this project was to build that client layer.
I needed to connect a Java desktop application to MySQL, manage connection state, execute different types of SQL commands, and present arbitrary query results in a usable interface.
A fixed table design would only work for one known query, so I also needed a way for the interface to adapt to whichever columns the database returned.
Core Features
MySQL Connection Interface
The Swing interface provides controls for selecting database configuration, entering credentials, connecting to MySQL, and disconnecting from the server.
Connection failures are surfaced through error dialogs, while successful connections update the application's connection status.
Authentication itself is handled by the MySQL server using the username and password supplied by the user rather than by a separate custom authentication system.
SQL Command Execution
Once connected, I can enter an SQL statement directly into the application.
SELECT statements are executed as database queries and displayed as structured results.
Other commands use JDBC's update execution path and report the number of affected rows.
This allows the application to function as a general SQL client rather than being limited to one predefined CRUD workflow.
Dynamic Result Display
Query results are displayed using a custom Java AbstractTableModel.
Instead of hard-coding column names and data types, the model reads metadata from the JDBC ResultSet and determines:
- the number of columns
- column names
- Java data types
- row count
- individual cell values
The Swing table can therefore adapt to different SELECT queries automatically.
Standout: Dynamic JDBC Result Modeling
The most technically interesting part of the project is the reusable result-set model.
A normal business application often knows in advance exactly which fields it will display. A general SQL client does not.
I built the result model around JDBC metadata so that the interface could inspect the returned dataset and construct the appropriate table structure at runtime.
This creates a useful separation between the database query and the visual representation of its results.
Standout: Two-Tier Client-Server Architecture
The project uses a direct two-tier architecture:
Java Swing Client → JDBC → MySQL
There is no intermediary web API or application server.
The desktop application creates the database connection itself, sends commands through JDBC, receives the result set, and converts those database results into Swing table data.
This project helped demonstrate the complete path between a desktop interface and a relational database rather than only writing isolated SQL statements.
Standout: Query and Update Handling
The application distinguishes SELECT queries from other SQL operations.
SELECT statements produce result sets that are passed into the dynamic table model.
Other SQL statements are executed through JDBC's update mechanism and return the number of affected rows.
This allows one interface to support both data retrieval and database modification workflows.
Technical Implementation / Approach
The application is implemented in Java Swing.
The main interface handles user input and events, while a separate ResultSetTableModel manages JDBC connections and converts SQL results into data Swing can render.
The table model maintains the active JDBC connection, statement, result set, metadata, and connection state.
Architecture / Tech Stack
Desktop Interface:
Java Swing
Database Connectivity:
JDBC
Database:
MySQL
Architecture:
Two-tier client-server application
Important Logic:
Dynamic ResultSet and ResultSetMetaData mapping through a custom AbstractTableModel
Engineering Summary
- Built a direct Java-to-MySQL client using JDBC rather than placing an API between the interface and database.
- Created a reusable table model that adapts automatically to different SQL query result structures.
- Separated Swing interface behavior from the database result-model layer.
- Supported both query retrieval and SQL update execution through a single desktop client.