Question: 2 . ) Modify 1 . ) from above. Add a new Method called selectDB ( ) that takes only one argument, SID. When a

2.) Modify 1.) 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 s1= new Student();
s1.selectDB(4); //accessing DB
s1.display(); //displays all data from DB for student with id=4
3.) Modify 2.) from above. This time we are add another method called insertDB(). This method will take all 5 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 s2=new Student();
s2.insertDB(33,Frank,Mayes,fmayes@yahoo.com,3.3);
s2.display();
4.) Lastly add 2 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!