{"id":20744431,"url":"https://github.com/nickklos10/sql-client-app","last_synced_at":"2025-06-17T21:42:32.068Z","repository":{"id":258447324,"uuid":"873941531","full_name":"nickklos10/SQL-Client-APP","owner":"nickklos10","description":"Two-tier Java client-server application that uses JDBC to connect multiple client users with different permissions to a MySQL database.","archived":false,"fork":false,"pushed_at":"2024-11-04T00:43:34.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T12:51:22.515Z","etag":null,"topics":["database-management","java","jdbc","mysql","oop","sql"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickklos10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-17T01:33:56.000Z","updated_at":"2024-11-04T00:43:37.000Z","dependencies_parsed_at":"2024-11-17T07:15:36.502Z","dependency_job_id":"1fc2b2b0-25a3-48b5-998b-facda291fb2d","html_url":"https://github.com/nickklos10/SQL-Client-APP","commit_stats":null,"previous_names":["nickklos10/sql-client-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nickklos10/SQL-Client-APP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickklos10%2FSQL-Client-APP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickklos10%2FSQL-Client-APP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickklos10%2FSQL-Client-APP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickklos10%2FSQL-Client-APP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickklos10","download_url":"https://codeload.github.com/nickklos10/SQL-Client-APP/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickklos10%2FSQL-Client-APP/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260445453,"owners_count":23010385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-management","java","jdbc","mysql","oop","sql"],"created_at":"2024-11-17T07:15:33.118Z","updated_at":"2025-06-17T21:42:27.027Z","avatar_url":"https://github.com/nickklos10.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Two-Tier Client-Server Application Using MySQL and JDBC\n\n## Overview\n\nThis project is designed to create two Java-based GUI applications that interact with a MySQL database via JDBC, focusing on client-server interactions. The first application allows clients to execute SQL commands, while the second is a specialized accountant-level client for querying transaction logs.\n\n## Table of Contents\n\n1. [Objectives](#objectives)\n2. [Technologies Used](#technologies-used)\n3. [Features](#features)\n4. [User Instructions](#user-instructions)\n5. [Application Design](#application-design)\n    - [Main Client Application](#main-client-application)\n    - [Accountant Application](#accountant-application)\n6. [Database Setup](#database-setup)\n\n---\n\n## Objectives\n\nThe project focuses on developing two-tier Java client-server applications that connect to a MySQL database using JDBC. It emphasizes learning how JDBC handles SQL operations and ensuring that multiple clients with different permissions can interact with a MySQL DB server simultaneously.\n\n## Technologies Used\n\n- **Java**: GUI development (Swing)\n- **MySQL**: Database server\n- **JDBC**: Database connectivity\n- **Properties Files**: Store user credentials and database connection information\n- **Git**: Version control\n- **NetBeans or IntelliJ IDEA**: IDEs for development\n\n## Features\n\n1. **Multiple Clients**: The application allows multiple client users with different levels of permissions to connect to the MySQL server.\n2. **SQL Execution**: Users can execute SQL DML and DDL commands from the GUI (select, insert, update, delete).\n3. **Prepared Statements**: The project uses JDBC’s PreparedStatement interface for issuing SQL commands securely.\n4. **Transaction Logging**: All SQL operations are logged into a separate `operationslog` database.\n5. **Accountant Client**: A specialized GUI for accountant-level users to view transaction logs.\n6. **Error Handling**: Users are notified of any SQL execution errors, and invalid credentials prevent connections to the database.\n\n---\n\n## User Instructions\n\n1. **Setting Up the Application**:\n   - Download the source code.\n   - Use the provided scripts to set up the MySQL databases (`project3` and `operationslog`).\n   - Create and configure user accounts in MySQL (root, client1, client2, project3app, theaccountant).\n   \n2. **Running the Client Application**:\n   - Open the `MainClientApplication.java` file and run the application.\n   - Enter the appropriate username and password from the GUI.\n   - Select a database, enter an SQL command, and press \"Execute.\"\n   - The results or status will be displayed in the result area.\n\n3. **Running the Accountant Application**:\n   - Open the `AccountantApplication.java` file and run the application.\n   - Enter the `theaccountant` credentials, connect to the `operationslog` database, and run queries related to transaction logging.\n\n---\n\n## Application Design\n\n### Main Client Application\n\n- **File**: `MainClientApplication.java`\n- **Purpose**: General clients use this application to issue SQL commands on the `project3` and `bikedb` databases.\n- **Functionality**:\n  - GUI interface for selecting a properties file to establish database connections.\n  - Executes SQL queries and displays results.\n  - Logs all transactions (successful queries and updates) into the `operationslog` database.\n  \n### Accountant Application\n\n- **File**: `AccountantApplication.java`\n- **Purpose**: This application is specialized for an accountant-level user to monitor transaction logs in the `operationslog` database.\n- **Functionality**:\n  - Allows querying of the transaction logging database.\n  - Does not permit modification or access to other databases.\n  \n---\n\n## Database Setup\n\n1. **Create Databases**:\n   - Run the `project3dbscript.sql` to create the `project3` database.\n   - Run the `project3operationslog.sql` to create the `operationslog` database.\n\n2. **Create Client Users**:\n   - Execute the `clientCreationScriptProject3.sql` script to create the following MySQL users: `client1`, `client2`, `project3app`, and `theaccountant`.\n   \n3. **Assign Permissions**:\n   - Use the `clientPermissionsScriptProject3.sql` to grant each client specific permissions to interact with the databases:\n     - `client1`: Select permissions on `project3` and `bikedb`.\n     - `client2`: Select and update permissions on `project3` and `bikedb`.\n     - `project3app`: Select, insert, update on `operationslog`.\n     - `theaccountant`: Select on `operationslog`.\n\n\n\n## Conclusion\n\nThis project demonstrates the development of a two-tier Java client-server system using MySQL and JDBC, with multiple client permissions, transaction logging, and a specialized monitoring application for accountant-level users. Follow the setup instructions and ensure that MySQL is configured properly to run the applications successfully.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickklos10%2Fsql-client-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickklos10%2Fsql-client-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickklos10%2Fsql-client-app/lists"}