0% found this document useful (0 votes)
11 views2 pages

MySQL & Java CRUD Setup Guide

Uploaded by

preetisunar586
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

MySQL & Java CRUD Setup Guide

Uploaded by

preetisunar586
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Step 1: Install & Set Up MySQL

• Install MySQL Server & Workbench.


• Create MySQL user (optional).
• Confirm MySQL is running.

Step 2: Create Database


Run this in MySQL Workbench:

CREATE DATABASE studentdb;


USE studentdb;

Step 3: Create Table


CREATE TABLE students (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(100),
age INT,
course VARCHAR(100)
);

Step 4: Install Eclipse IDE


• Download Eclipse IDE for Java Developers.
• Configure workspace.

Step 5: Add MySQL JDBC Driver


(Connector/J)
• Download [Link]
• In Eclipse:
Right-click Project → Build Path → Add External Archives →
Select JAR

Step 6: Create Java Project Structure


Inside Eclipse:

src
└── [Link]
│── [Link]
│── [Link]
│── [Link]
│── [Link]
│── [Link]
Step 7: Write DBConnection Class
• Handles database connectivity.
• Uses [Link]().

Step 8: Create Student Model Class


• Represents one student record.
• Contains variables (id, name, email, age, course).

Step 9: Write CRUD Logic


You will create:

1. StudentDAO interface → lists methods


2. StudentDAOImpl class → writes SQL code for:
o Add Student
o Update Student
o Delete Student
o Get Student by ID
o Get All Students

Step 10: Create Main Class (Console Menu)


• Accept user input using Scanner
• Call DAO methods
• Display results
• Test all CRUD operations

You might also like