Question: 1.) package Student; class Student { private int ID; private String FirstName; private String LastName; private String Street; private String City; private String State; private
1.) package Student;
class Student { private int ID; private String FirstName; private String LastName; private String Street; private String City; private String State; private String EMail; private long Zip; private double GPA;
public Student() { FirstName = ""; LastName = ""; Street = ""; City = ""; State = ""; EMail = ""; }
public Student(int ID, String firstName, String lastName, String street, String city, String state, long zip, String email, double GPA) { this.ID = ID; this.FirstName = firstName; this.LastName = lastName; this.Street = street; this.City = city; this.State = state; this.EMail = email; this.Zip = zip; this.GPA = GPA; }
public String getAddress() { return Street; }
public void setAddress(String address) { Street = address; }
public String getCity() { return City; }
public void setCity(String city) { City = city; }
public String getState() { return State; }
public void setState(String state) { State = state; }
public String getEMail() { return EMail; }
public void setEmail(String email) { EMail = email; }
public long getZip() { return Zip; }
public void setZip(long zip) { Zip = zip; }
public double getGPA() { return GPA; }
public void setGPA(double GPA) { this.GPA = GPA; }
public int getID() { return ID; }
public void setID(int ID) { this.ID = ID; }
public String getFirstName() { return FirstName; }
public void setFirstName(String firstName) { FirstName = firstName; }
public String getLastName() { return LastName; }
public void setLastName(String lastName) { LastName = lastName; }
public void display() { System.out.println("ID : " + ID); System.out.println("Name : " + FirstName + " " + LastName); System.out.println("Address : " + Street); System.out.println("City : " + City); System.out.println("State : " + State); System.out.println("Zip : " + Zip); System.out.println("Email : " + EMail); System.out.println("GPA : " + GPA); } public static void main(String[] args) { Student s1 = new Student(4, "Frank", "Jones", "123 Main", "Atlanta", "GA", 30133, "fj@yahoo.com", 3.2); s1.display(); } }
QUESTION BELOW
2.Modify 1.) from above. Add a new Method called selectDB() that takes only one argument, ID. 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

Table Teal Accuen .Usar Berlin Earples (1) In.. Walton THtme trofi Inhu... X Co Review . Text Court w Fic H Hone External D Database Tael Help Taal: Fields Ptal me what you want to do e X V 2.1Aceriding aan BON sls O Replare Caliri v 11 Descendine y Avanced Soeling Vi Tier Refresh Stich Formatlar 4- X Delete Delehe More FilFun Wiini- ciphard Sat Fiat Rende ind Test Famattina Custom Custom Group Unassigned Objerti E! Sucent: in - FirstName - sstt.me - Stre State Zo - EMail - - GRAD Instructors LITE Jurres 200LS Dernet 29:21 larry@yahoo.com 3.2 2 Deals Gibson 101 Camhelst Setini Chica IL 61721 Gebrotmail. Santa 3 James Henry 2019 Parli. Atlanta 309B: heyanco.am 4 luni IT 100M SUBSL tony@yahoo.com 3.- 30.don.co.id 5 Marie Saker 19 Mockingh Setia 94211 mboken mail 2.3 6 Mor; Westhes 10 Kingst Conver 65334 marybellsouth blest IL 6190 billion 2.5 Tim Allan 200 South St Dernit MI 5412 9 Gar; Stevens 112 Plynchen Ann Arbor MI 5412: garys@hotmail.co 10 B Cuck 101 esor: Allants -101. twakatwo.com 11 Susan onas 200 Watt Marieta 2005 janechat nail 12 Frank Peters 3845 Bakio de San Diego ca 3512: frankpeterscom 13 leri March 16 Halep St LOUIS MO 1932 match bellsoul 31 14 IAK Hinas 7322 Mamireside Cr Malta 2009 jinasiyaha.cn 2. 15 Phil Gecko Mortgomery AL 4123 gecko@yahcoc 1b lung Peters 200 Carave NI -L 0 c c Lopi Pasaud Reg... demora 2.de. Lichame.. yon. WE Lad B-100 Exploited Demeos TestExcepo... Dom.com w Renn 1 of 16 H Nor Her Seh Cater unlock #N 220 Y15 "Sar2 Test " Arraih Type here to search 4 10:11 AM V15/2021
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
