LAB ACTIVITY 4D
Manipulates JDBC connectivity.
Manipulates JDBC connectivity.
Learning Outcomes
By the end of this lab, students should be able to :
Arranges JDBC for database connectivity by applying the appropriate steps.
Hardware/ Software : Personal Computer, Java Development Kit version X.x.x., NetBeans IDE 12.0
LAB ACTIVITY 4D
Activity Outcome: Student know how to use JDBC
Open MySQL and create a database called studentDB.
Create a table named student_details to store the student information
Open your Java IDE (e.g., NetBeans, Eclipse) and create a new project.
Add the MySQL JDBC Driver (mysql-connector-java.jar) to your project’s classpath.
Use Java Swing to create the interface as shown in the image you provided.
2. The code to create the interface can look like this (you may adjust it as needed):
Create a class to manage the connection to the database:
1. ADD Button:
When the ADD button is clicked, it should insert data into the student_details table.
2. CLEAR Button:
The CLEAR button should reset the form fields.
3. DISPLAY Button:
The DISPLAY button should retrieve and display records from the database.
4. UPDATE Button:
The UPDATE button updates a record based on the IC_NUMBER.
5. DELETE Button:
The DELETE button removes a record based on the IC_NUMBER.
Refer to the video below for the video version.
VIDEO PART 1 - ARRANGE INTERFACE USING SETBOUND , IF YOU ARE USING ANOTHER LAYOUT, Please Start Video From 29.00