Management student (create, update, get, list, delete) using JDBC in Java
Step 1: Let create a Student table in MySQL student_management database:
CREATE TABLE Student(
ID INT NOT NULL AUTO_INCREMENT,
NAME VARCHAR(20) NOT NULL,
AGE INT NOT NULL,
PRIMARY KEY (ID)
Step 2: Call Main.java class to choose option:
// Choose option you want:
System.out.println("Choose option: ");
System.out.println("1 - Add student");
System.out.println("2 - Get sudent by id");
System.out.println("3 - List all students");
System.out.println("4 - Update for student");
System.out.println("5 - Delete for student");
Option 1: Create a student
Option 3: List all students