Skip to content

shri-lab/DatabaseConnectivity-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Database Connectivity using Java (JDBC)

๐Ÿ“Œ Overview

This project demonstrates how a Java application connects to a MySQL database using JDBC (Java Database Connectivity) to retrieve and display data from a database table.
The application establishes a database connection, executes an SQL query, and prints the retrieved records in the console.

This task was completed as part of an internship assignment to gain practical experience in backend development and database integration.


๐ŸŽฏ Objective

  • Build a Java application that connects to a MySQL database
  • Retrieve data from a database table using JDBC
  • Display the retrieved data in the console

๐Ÿ› ๏ธ Technologies & Tools Used

  • Java
  • JDBC (MySQL Connector/J)
  • MySQL
  • Eclipse IDE
  • Git & GitHub

๐Ÿ—„๏ธ Database Details

  • Database Name: testdb
  • Table Name: students

Table Structure

Column Data Type
id INT (Primary Key)
name VARCHAR
age INT

โš™๏ธ How the Application Works

  1. Establishes a connection to the MySQL database using DriverManager
  2. Executes a SELECT SQL query on the students table
  3. Retrieves records using ResultSet
  4. Displays the retrieved data in the console
  5. Properly closes all database resources to avoid memory leaks

๐Ÿš€ Future Enhancements

  • Remove spaces and special characters before checking
  • Use two-pointer technique instead of reversing the string
  • Extend functionality to check sentences and phrases

โ–ถ๏ธ Sample Input

image

About

Java application using JDBC to connect to MySQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages