+1(805) 568 7317

we have been working with the front end gui and the middle creating and manipulating 4945624

We have been working with the front-end (GUI), and the middle(creating and manipulating collections of objects), and now we willadd on the back end. The persistent storage of data in yourapplications. This exercise is to get you comfortable withconnecting to a DB, adding, deleting, retrieving data.  I encourage you to play with this one, do more than theminimum. SQLite is a very smalldatabase. It is included by default in Android and iOS. It issurprisingly powerful for such a small footprint. It can befrustrating to see what’s going on – what is in the DB, did thequery work correctly?     MySQL is often calleda community database. It belongs to Oracle, but they allow anyoneto use it for free.   The recent versions of the MySQLworkbench that allows you to see what’s going on in your databaseare really very nice – starting to look like the Access frontend.   Create a connection toa relational database using SQLite or MySQL. Create a singledatabase table to hold information. Let’s make a simpleclass called Person for this exercise. Person firstName (String) lastName(String) age (int) ssn (long) creditCard (long) Note that once youhave the DB created, you don’t want to do this again every time yourun your test program. The easiest way to deal with this – for thisassignment, is to comment out the code that creates the DB creationand the table creation while you experiment with thefollowing. (Aside: I choose ssn and credit card as fields here so that youmight think about the persistent storage of sensitive data. Thereare some pretty strict laws governing the storage of somedata.    Please don’t use any actual social securitynumbers or credit card numbers in this exercise.) Demonstrate theinsertion of a record into the database Insert several records. Write a method calledinsertPerson(Person person) that adds a person object to yourdatabase. Create another object of type Person, and demonstratecalling your method, passing the object to the method. Demonstrate theretrieval of information from the database. Use SQL Selectstatements, to retrieve a particular Person from the database. Write a method calledselectPerson that returns a Person object. This method retrievesthe data for a Person from the database. We also need to pass aparameter to identify what person. You can use ‘name’ if you like,or if you find it easier to use the database generated ID that’sfine too. This method returns the object that represents that person. Thiswill require that you extract the data that is returned from thedatabase, and call the Person constructor. (Later you willunderstand that that this is the data-exchange between therelational database and the business layer. ) Write a method calledfindAllPeople that returns an ArrayList of objectscontaining all the people in the database.   Demonstratethat it is working correctly. Write a method calleddeletePerson that removes a person from the database. Theparameters will be first name and last name. Print out on theconsole the data from the record that is being deleted. Use yourfindAllPeople method to verify that that person has been removedfrom the database. Consider what this method should return. Supposethe person is not found, should the method return that informationsomehow? please submit ascopiable code! thank you! . . .

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon

Order Now