This project demonstrates the integration of Java and MySQL using the JDBC API (Java Database Connectivity Application Programming Interface) to perform basic database operations (Insert, Select, Update, and Delete). It is designed as a simple yet practical example of how Java applications can interact with relational databases.
- Database Connectivity: Establishes a connection to a MySQL database using JDBC.
- CRUD Operations: Implements Create, Read, Update, and Delete operations.
- Dynamic Queries: Users can modify the database configuration to suit their setup.
To run this project, ensure the following tools and dependencies are installed:
- Java Development Kit (JDK): Version 8 or higher.
- MySQL Server: To host the database.
- FortiClient VPN: Required to connect to the university's database server (if applicable).
- Eclipse IDE: Recommended for editing and running the code.
- My SQL Connector JAR: Required for establishing a JDBC connection.
- Download the "Platform Independent" version from the Download MySQL Connector
- Extract the ZIP archive and locate the mysql-connector-java-.jar file.
- Add the JAR file to your project's classpath in Eclipse:
- Right-click your project > Build Path > Add External Archives.
- Select the downloaded JAR file.
- Import the provided SQL script (database_schema.sql) into your MySQL server to create the necessary database and tables.
- Update the database connection details in the POS.java file. String DB_URL = "jdbc:mysql://:3306/"; String DB_USER = ""; String DB_PASSWORD = "";
- Download the MySQL Connector JAR file from the link above.
- Follow steps to add the JAR file into project's classpath.
- Install and configure FortiClient VPN.
- Log in to your university's VPN to access the database server.
- Open the project in Eclipse.
- Run the POS.java class.
- View the console for outputs of the CRUD operations.
- Replace the provided database connection details with your own if using a different MySQL server.
- Ensure VPN access is enabled if the database is hosted remotely.
- Modify the SQL script or code as needed to adapt to different database schemas.
- src/ folder: Contains the Java source code.
- database_schema.sql: SQL script for creating the database and tables.
- README.md: Documentation for the project.
This project is open-source and free to use for educational purposes. Attribution is appreciated.
Special thank you to the University of North Florida for providing access to the database server and resources.