Question: 2 . ) Modify 1 . ) from above. Add a new Method called selectDB ( ) that takes only one argument, SID. When a
Modify from above. Add a new Method called selectDB that takes only one argument, SID. When a user calls this method, it should SELECT from the database that Student and get all the Students data from the database, and put this data into the appropriate properties. Hint: You will use an SQL Select statement here. Test out this method in the main.
Testing Code in Main method
Student s new Student;
sselectDB; accessing DB
sdisplay; displays all data from DB for student with id
Modify from above. This time we are add another method called insertDB This method will take all data elements as arguments. This method will then Insert this information into the Student table, as well as fill up the object with the data provided. Hint: You will use an SQL Insert statement here.
Testing Code in Main method
Student snew Student;
sinsertDBFrankMayesfmayes@yahoo.com;
sdisplay;
Lastly add functions to your Student class, updateDB and deleteDB These functions will update and delete student data in the database.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
