Skip to content

Java application that uses JDBC (Java Database Connectivity) to connect to a MySQL database, featuring a Java Swing-based graphical user interface (GUI) for interacting with the database.

License

Notifications You must be signed in to change notification settings

petarmilunovic/jdbc-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JDBC GUI Demo Application

Overview

Simple Java Application that demonstrates the use of JDBC (Java Database Connectivity) to connect to a MySQL database. The application also includes a graphical user interface (GUI) built using Java Swing.

Features

  • Connects to a MySQL database using JDBC
  • Supports basic database operations such as adding, removing, and searching for users
  • Provides a simple and intuitive interface for interacting with the database

Prerequisites

Before running the application, ensure you have the following:

  • Empty MySQL database which you will later use to import jdbc_demo.sql schema from this repository
  • The JDBC driver required to connect to MySQL

Setup Instructions

  1. Clone the Repository:

    git clone https://github.com/petarmilunovic/jdbc-demo.git
    cd jdbc-demo
    
  2. Add MySQL Connector/J to your project:

  • Download the mysql-connector-java-8.0.22 library from the MySQL website.
  • Add the JAR file to your project’s classpath.
  1. Configure Database Connection:
  • Import the provided database schema jdbc_demo.sql into your empty MySQL database. The schema is essential as it contains the specific columns and data types required by the application:

    mysql -u your-username -p your-empty-database < "absolute_path/to/jdbc_demo.sql"
  • Modify the connect() method in Database.java file to use your database’s details and credentials.

  1. Run the Application:
  • Compile and run the application from your IDE.
  • Use the GUI to perform CRUD operations on the database.

About

Java application that uses JDBC (Java Database Connectivity) to connect to a MySQL database, featuring a Java Swing-based graphical user interface (GUI) for interacting with the database.

Topics

Resources

License

Stars

Watchers

Forks

Languages