[login to view URL] a connection to a relational database using SQLite or MySQL.
[login to view URL] a single database table to hold information.
Let’s make a simple class called Person for this exercise.
Note that once you have the DB created, you don’t want to do this again every time you run your test program. The easiest way to deal with this – for this assignment, is to comment out the code that creates the DB creation and the table creation while you experiment with the following.
(Aside: I choose ssn and credit card as fields here so that you might think about the persistent storage of sensitive data. There are some pretty strict laws governing the storage of some data. Please don’t use any actual social security numbers or credit card numbers in this exercise.)
[login to view URL] the insertion of a record into the database Insert several records.
[login to view URL] a method called insertPerson(Person person) that adds a person object to your database. Create another object of type Person, and demonstrate calling your method, passing the object to the method.
[login to view URL] the retrieval of information from the database. Use SQL Select statements, to retrieve a particular Person from the database.
[login to view URL] a method called selectPerson that returns a Person object. This method retrieves the data for a Person from the database. We also need to pass a parameter to identify what person. You can use ‘name’ if you like, or if you find it easier to use the database generated ID that’s fine too.
[login to view URL] method returns the object that represents that person. This will require that you extract the data that is returned from the database, and call the Person constructor. (Later you will understand that that this is the data-exchange between the relational database and the business layer. )
[login to view URL] a method called findAllPeople that returns an ArrayList<Person> of objects containing all the people in the database. Demonstrate that it is working correctly.
[login to view URL] a method called deletePerson that removes a person from the database. The parameters will be first name and last name. Print out on the console the data from the record that is being deleted. Use your findAllPeople method to verify that that person has been removed from the database. Consider what this method should return. Suppose the person is not found, should the method return that information somehow?
27 freelanceria on tarjonnut keskimäärin 49$ tähän työhön
Hello. I am full-stack web developer and expert in SQL databases. I read your description and I can do this task in 2 hours. Send me message so we can talk about details and I can start working.
I have well experience in MySQL to create tables, writing various query to retrieval of information from the relation and also usage of DDL, DML, TCL, ect., will provide work on time with 100% quality as you expected.
hi...being Java Certified Developer I assure you to complete the entire within 2 working days. by tomorrow eod you would have your assignment ready or maybe even less than that time. pinge once to discuss further