Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CIST 2 3 7 2 Java Programming II LUAB # 9 ( 5 0 Points ) Business Objects In this lab, you will be working
CIST
Java Programming II
LUAB # Points
Business Objects
In this lab, you will be working with Business Objects and DBs
Create a class called Student This class will not be tied to the Database, yet. The Smient class shoula have the these properties: sid int or String firstiameString lastVameSring emailSting geadouble
Include all the set and get finctions as needed. Include constructors, an empty constructor, and one that takes all properties. Include a display method that prints out all properties. Use a main to instantiate and test out this Student class. Itint: No database calls in this class, yet.
Testing Code in Main method
Students new Student "Frank', "Jones", Ji@yahoo.com", ;
s displav:
Modify from above. Add a new Method called selecipBo that tikes only one argument, SID. When a user calls this method, it should SELECT from the database that Student and get all the Student's data from the database, and put this data into the appropriate properties. fint: You will use an SOL Select statement here. Test out this method in the main.
Testing Code in Maino method
Sindent s new Student:
S saleciDR; Ilaccessing DB
s disolav: Idisplays all data fiom DB for student with id
Modify from above. This time we are add another method called insecUDB This method will take all data elements as arguments. This method will then Insert this infomation imto the Smolent mble, as well as fill up the object with the data provided. H Tint: You will use an SQL Insert statement here.
Terting Code in Nhino merthod
Student snew Studento:
sqinserin: "Frank, Mayes",
timayes@yahoo.com;;
S disolay:
Lastly add fimctions to your Student class, Hpedated and dethe.RBO. These finctions will update and delete student data in the database.
Taxing Code in Mmint metiod
Student new Studanto:
Siselactid: :
S B : :
And
Student new Student :
SA GeleatDP T:
Ichange any property in the student object
The example below changes the lastname.
llbut you could change email, or gpa as well
S setl astnameSmith;
ISA mpdatamB: ; send any changes to the DB S nndateDB:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started