Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Java MySQL Database Application

This is a simple Java application that demonstrates how to connect to a MySQL database using JDBC. The application connects to a local MySQL database, performs database operations (such as querying or updating), and handles SQL exceptions.

Features

  • JDBC Connection: The application establishes a connection to a MySQL database using the JDBC driver.
  • SQL Queries: Interacts with a MySQL database, potentially allowing data manipulation and retrieval.
  • Exception Handling: Catches and handles SQL and ClassNotFound exceptions.

Requirements

  • Java Development Kit (JDK): Version 8 or above.
  • MySQL: Ensure MySQL is installed and running locally.
  • JDBC Driver: The MySQL JDBC driver (com.mysql.jdbc.Driver) must be included in the project.
  • Database Setup: A MySQL database with the schema v_project and user credentials as defined in the code.

How to Run

  1. Clone the repository:

    git clone https://github.com/sarveshdesai/java-mysql-app.git
  2. Install MySQL and create the required database:

    CREATE DATABASE v_project;
  3. Modify Database Credentials: Update the following line in the App.java file with your MySQL username and password:

    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/v_project", "root", "1234");
  4. Compile the Java program:

    javac App.java
  5. Run the application:

    java App

Code Overview

The main steps in the program include:

  • Loading the JDBC driver:

    Class.forName("com.mysql.jdbc.Driver");
  • Connecting to the database:

    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/v_project", "root", "1234");
  • Handling Exceptions: Proper handling for ClassNotFoundException and SQLException is implemented:

    catch (ClassNotFoundException e) {
        e.printStackTrace();
    }

Contributing

Contributions to improve the application or add new features are welcome. To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature:
    git checkout -b feature/YourFeature
  3. Make your changes and commit:
    git commit -m 'Add feature'
  4. Push to your fork:
    git push origin feature/YourFeature
  5. Submit a pull request for review.

Contact

For any inquiries or issues, please reach out to the project maintainers at sarveshdesaigp@gmail.com.

About

DBMS Project JDBC

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages