SlideShare a Scribd company logo
1 of 4
Download to read offline
Create a student record management system using linked list and queue using Java language and
database to save files and GUI Java swing to create background and also use HTML.
With the following properties
A . register students(assume each students has ID, first name ,last name and middle name)
B.register students with courses(course no ,course title crh)
C.able to maintain grade on which course they are registered
d.searches students by ID displays if found
E.searches by course name
F. sorts student name in alphabetical order
G.displays the details of all students
H.Deletes a student by id
I.Deletes a course by courseNo
J. Handles errors in informative ways .
Solution
public class StudentRegistration extends JFrame implements ActionListener{
JLabel idLabel, fnameLabel, midnameLabel, lastnameLabel, courseLabel;
JTextField idField, fnameField, midnameField, lastnameField, courseField;
JButton registerButton;
JPanel panel;
List list = new ArrayList();
StudentRegistration() {
setSize(800, 400);
setLayout(null);
idLabel = new JLabel("ID");
fnameLabel = new JLabel("First Name");
midnameLabel = new JLabel("Mid Name");
lastnameLabel = new JLabel("Last Name");
courseLabel = new JLabel("Course");
// Defining ID field
idField = new JTextField();
idField.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
}
});
// Defining Name field
fnameField = new JTextField();
fnameField.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
}
});
registerButton
= new JButton("Register");
registerButton.addActionListener(this);
add(idLabel);
add(fnameLabel);
add(midnameLabel);
add(lastnameLabel);
add(courseLabel);
add(idField);
add(fnameField);
add(midnameField);
add(lastnameField);
add(courseField);
add(registerButton);
list.add(new User(idField.getText(), fnameField.getText(),midnameField.getText(),
lastnameField.getText(),courseField.getText()));
saveValues();
JOptionPane.showMessageDialog(this,
"Student Successfully Registered");
}
}
public void saveValues() throws SQLException {
User str = list.get(list.size()-1);
Connection connection = null;
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost/testdb";
String user = "root";
String password = "";
connection = DriverManager.getConnection(url,
user, password);
Statement stmt = connection.createStatement();
String sql = "INSERT INTO students(str.fname,str.midname,str.lastname,str.course) ";
stmt.execute(sql);
}
public static void
main(String[] args) {
new StudentRegistration();
}
}

More Related Content

More from info309708

How do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdfHow do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdfinfo309708
 
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdfHere are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdfinfo309708
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfinfo309708
 
For this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdfFor this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdfinfo309708
 
Discuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdfDiscuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdfinfo309708
 
Describe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdfDescribe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdfinfo309708
 
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdfCoca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdfinfo309708
 
C programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdfC programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdfinfo309708
 
Biology LabThe poisonous wastes of diptheria germs are called (A).pdf
Biology LabThe poisonous wastes of diptheria germs are called (A).pdfBiology LabThe poisonous wastes of diptheria germs are called (A).pdf
Biology LabThe poisonous wastes of diptheria germs are called (A).pdfinfo309708
 
Aside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdfAside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdfinfo309708
 
Yates (2009) notes that unions have a purpose broader than serving t.pdf
Yates (2009) notes that unions have a purpose broader than serving t.pdfYates (2009) notes that unions have a purpose broader than serving t.pdf
Yates (2009) notes that unions have a purpose broader than serving t.pdfinfo309708
 
write a C program for blinking light using function make sure it.pdf
write a C program for blinking light using function make sure it.pdfwrite a C program for blinking light using function make sure it.pdf
write a C program for blinking light using function make sure it.pdfinfo309708
 
Which of the following is not true about prokaryotes 1) They are th.pdf
Which of the following is not true about prokaryotes  1) They are th.pdfWhich of the following is not true about prokaryotes  1) They are th.pdf
Which of the following is not true about prokaryotes 1) They are th.pdfinfo309708
 
Which mitotic microtubules radiate outward from centrosome into the r.pdf
Which mitotic microtubules radiate outward from centrosome into the r.pdfWhich mitotic microtubules radiate outward from centrosome into the r.pdf
Which mitotic microtubules radiate outward from centrosome into the r.pdfinfo309708
 
What type of motion best describes flexion of the trunk about the hi.pdf
What type of motion best describes flexion of the trunk about the hi.pdfWhat type of motion best describes flexion of the trunk about the hi.pdf
What type of motion best describes flexion of the trunk about the hi.pdfinfo309708
 
what is the relationship between information hiding as an attribute .pdf
what is the relationship between information hiding as an attribute .pdfwhat is the relationship between information hiding as an attribute .pdf
what is the relationship between information hiding as an attribute .pdfinfo309708
 
What is FERPA How does this impact youSolutionFERPA- FER.pdf
What is FERPA How does this impact youSolutionFERPA- FER.pdfWhat is FERPA How does this impact youSolutionFERPA- FER.pdf
What is FERPA How does this impact youSolutionFERPA- FER.pdfinfo309708
 
What form of market efficiency do you think that the U. S. financial.pdf
What form of market efficiency do you think that the U. S. financial.pdfWhat form of market efficiency do you think that the U. S. financial.pdf
What form of market efficiency do you think that the U. S. financial.pdfinfo309708
 
What are the biggest threats to a network in terms of security and w.pdf
What are the biggest threats to a network in terms of security and w.pdfWhat are the biggest threats to a network in terms of security and w.pdf
What are the biggest threats to a network in terms of security and w.pdfinfo309708
 
This Question 1 pt One of the biggest factors in implementing SOX wa.pdf
This Question 1 pt One of the biggest factors in implementing SOX wa.pdfThis Question 1 pt One of the biggest factors in implementing SOX wa.pdf
This Question 1 pt One of the biggest factors in implementing SOX wa.pdfinfo309708
 

More from info309708 (20)

How do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdfHow do you evaluate your own global mind set levelsSolutionAN.pdf
How do you evaluate your own global mind set levelsSolutionAN.pdf
 
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdfHere are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
Here are two datasetsDataset A 64 65 66 68 70 71 72Dataset B .pdf
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
 
For this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdfFor this homework, you will develop a class called VendingMachine th.pdf
For this homework, you will develop a class called VendingMachine th.pdf
 
Discuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdfDiscuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdf
 
Describe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdfDescribe the differences between the three major physical connection .pdf
Describe the differences between the three major physical connection .pdf
 
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdfCoca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
Coca-Cola companyStrategic Goals and Objectivesi. Objectives are.pdf
 
C programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdfC programming. Answer question only in C code Ninth Deletion with B.pdf
C programming. Answer question only in C code Ninth Deletion with B.pdf
 
Biology LabThe poisonous wastes of diptheria germs are called (A).pdf
Biology LabThe poisonous wastes of diptheria germs are called (A).pdfBiology LabThe poisonous wastes of diptheria germs are called (A).pdf
Biology LabThe poisonous wastes of diptheria germs are called (A).pdf
 
Aside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdfAside from the expansion of industrial capitalism, what factors affe.pdf
Aside from the expansion of industrial capitalism, what factors affe.pdf
 
Yates (2009) notes that unions have a purpose broader than serving t.pdf
Yates (2009) notes that unions have a purpose broader than serving t.pdfYates (2009) notes that unions have a purpose broader than serving t.pdf
Yates (2009) notes that unions have a purpose broader than serving t.pdf
 
write a C program for blinking light using function make sure it.pdf
write a C program for blinking light using function make sure it.pdfwrite a C program for blinking light using function make sure it.pdf
write a C program for blinking light using function make sure it.pdf
 
Which of the following is not true about prokaryotes 1) They are th.pdf
Which of the following is not true about prokaryotes  1) They are th.pdfWhich of the following is not true about prokaryotes  1) They are th.pdf
Which of the following is not true about prokaryotes 1) They are th.pdf
 
Which mitotic microtubules radiate outward from centrosome into the r.pdf
Which mitotic microtubules radiate outward from centrosome into the r.pdfWhich mitotic microtubules radiate outward from centrosome into the r.pdf
Which mitotic microtubules radiate outward from centrosome into the r.pdf
 
What type of motion best describes flexion of the trunk about the hi.pdf
What type of motion best describes flexion of the trunk about the hi.pdfWhat type of motion best describes flexion of the trunk about the hi.pdf
What type of motion best describes flexion of the trunk about the hi.pdf
 
what is the relationship between information hiding as an attribute .pdf
what is the relationship between information hiding as an attribute .pdfwhat is the relationship between information hiding as an attribute .pdf
what is the relationship between information hiding as an attribute .pdf
 
What is FERPA How does this impact youSolutionFERPA- FER.pdf
What is FERPA How does this impact youSolutionFERPA- FER.pdfWhat is FERPA How does this impact youSolutionFERPA- FER.pdf
What is FERPA How does this impact youSolutionFERPA- FER.pdf
 
What form of market efficiency do you think that the U. S. financial.pdf
What form of market efficiency do you think that the U. S. financial.pdfWhat form of market efficiency do you think that the U. S. financial.pdf
What form of market efficiency do you think that the U. S. financial.pdf
 
What are the biggest threats to a network in terms of security and w.pdf
What are the biggest threats to a network in terms of security and w.pdfWhat are the biggest threats to a network in terms of security and w.pdf
What are the biggest threats to a network in terms of security and w.pdf
 
This Question 1 pt One of the biggest factors in implementing SOX wa.pdf
This Question 1 pt One of the biggest factors in implementing SOX wa.pdfThis Question 1 pt One of the biggest factors in implementing SOX wa.pdf
This Question 1 pt One of the biggest factors in implementing SOX wa.pdf
 

Recently uploaded

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 

Recently uploaded (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

Create a student record management system using linked list and queu.pdf

  • 1. Create a student record management system using linked list and queue using Java language and database to save files and GUI Java swing to create background and also use HTML. With the following properties A . register students(assume each students has ID, first name ,last name and middle name) B.register students with courses(course no ,course title crh) C.able to maintain grade on which course they are registered d.searches students by ID displays if found E.searches by course name F. sorts student name in alphabetical order G.displays the details of all students H.Deletes a student by id I.Deletes a course by courseNo J. Handles errors in informative ways . Solution public class StudentRegistration extends JFrame implements ActionListener{ JLabel idLabel, fnameLabel, midnameLabel, lastnameLabel, courseLabel; JTextField idField, fnameField, midnameField, lastnameField, courseField; JButton registerButton; JPanel panel; List list = new ArrayList(); StudentRegistration() { setSize(800, 400); setLayout(null); idLabel = new JLabel("ID"); fnameLabel = new JLabel("First Name"); midnameLabel = new JLabel("Mid Name"); lastnameLabel = new JLabel("Last Name"); courseLabel = new JLabel("Course"); // Defining ID field
  • 2. idField = new JTextField(); idField.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { char c = e.getKeyChar(); } }); // Defining Name field fnameField = new JTextField(); fnameField.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { char c = e.getKeyChar(); } }); registerButton = new JButton("Register"); registerButton.addActionListener(this); add(idLabel); add(fnameLabel); add(midnameLabel); add(lastnameLabel); add(courseLabel); add(idField); add(fnameField); add(midnameField); add(lastnameField); add(courseField);
  • 3. add(registerButton); list.add(new User(idField.getText(), fnameField.getText(),midnameField.getText(), lastnameField.getText(),courseField.getText())); saveValues(); JOptionPane.showMessageDialog(this, "Student Successfully Registered"); } } public void saveValues() throws SQLException { User str = list.get(list.size()-1); Connection connection = null; Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost/testdb"; String user = "root"; String password = ""; connection = DriverManager.getConnection(url, user, password); Statement stmt = connection.createStatement(); String sql = "INSERT INTO students(str.fname,str.midname,str.lastname,str.course) "; stmt.execute(sql); } public static void main(String[] args) { new StudentRegistration(); }
  • 4. }