Create an instance function in the inventorymanager

Assignment Help Database Management System
Reference no: EM13757195

Part 1

Create an instance function in the InventoryManager class called getDatabaseConnection. This function should

• Create a new database if it does not exist.

• Create the tables if they do not already exist. You will need to do some research to determine the best way to do this. There are a few different approaches. Google is your friend. You will need two tables - one for household items and the other for food items. It is up to you to choose appropriate data types and column names.

• Set the value of a Connection field in the InventoryManager object. Your other methods should use this connection object.
? Specifically, you should have this in your InventoryManager:

private Connection _conn;

Create a second function called populateDatabase that is called only if the database has not previously been populated with data. Hint: If you had to create the tables in the step above, you can be sure that the tables need to be populated! This function should create records in the database for food and household items. Use the items from the example inventory file.

Verifying Your Data

Visual tools are great for looking at your data to insure that your code is working correctly.

Eclipse has a plugin for SQLite that you can install. You might also one of these tools:

• https://github.com/sqlitebrowser/sqlitebrowser/releases

• https://saxmike.com/MySoftware/MySoftware.asp?Menu=MYSOFTWARE

- 1 -Part 2

Complete the method load loadInventory() in the InventoryManager (there is a comment above it saying that it loads data from the database). In your main() function, replace the call the loadInventory("inventory.txt") with this call so that the data is loaded from the database instead of the file. If your code is correct, the output should be exactly the same as it was when you loaded the data from a file.

Reference no: EM13757195

Questions Cloud

Write an essay mini-ethnographic research or narrative : Write an essay Mini-Ethnographic Research or Narrative. As an ethnographic researcher, you'll be studying a social group or space to gain understanding of its social dynamics and how it relates to the larger cultural environment.
Concept help to determine the demand for labor : The demand for labor is said to be a "derived" demand.  What is the meaning of a derived demand? How does this concept help to determine the demand for labor?
Similarities between email tracking or news posting tracking : Discuss the differences and similarities between email tracking and news posting tracking.
Should us government play in health care for americans : What role, if any, should the U.S. Government play in health care coverage for Americans? Should the government's role in terms of health insurance be different for those with jobs and for those without jobs?
Create an instance function in the inventorymanager : Create an instance function in the InventoryManager class called getDatabaseConnection. This function should
Analyse information security vulnerabilities : analyse information security vulnerabilities and threats and determine appropriate controls that can be applied to mitigate the potential risks
Find three musicians or bands/groups that are from scotland : Find three musicians or bands/groups that are from Scotland. Not Ireland or England or Wales. Do some indepth research and pick and artist and a song that "speaks to you".
Develop a crud matrix : Develop a CRUD matrix that outlines the relationships among the pieces of information and user privileges
Analyze your own characteristics and behaviors : This assignment is an in-depth exploration and new understanding of you! You will use theories of personality to analyze your own characteristics and behaviors.

Reviews

Write a Review

 

Database Management System Questions & Answers

  Problem 1- customers with certain list patternsnbspproblem

problem 1- customers with certain list patternsnbspproblem descriptionnbsp you are provided with four tables in

  Database modeling and design

Database Modeling and Design: A complete table diagram. Transform model to tables, include all attributes and keys.

  Define relational databases

In this Discussion Board, you are asked to define and describe background information of a relational database. Include the following information.

  Write problems and issues related with internet databases

Write down some of problems and issues related with internet databases? Consider security, performance, architecture issues.

  Use oracle, list all system privileges assigned to user hr

Use Oracle, list ALL system privileges assigned to user HR. Please show screen shot if you can make it!

  Print to screen the ''below average''

Print to screen the 'below average' if minimum unit_cost is 10 for the same product (use sh.costs table)

  Create a database design

Create a database design (schema) based on the following problem description.

  A motor vehicle maintenance center wants to enhance its

write a 200- to 300-word short-answer response for the followinga motor vehicle maintenance center wants to improve its

  Draw an entity relationship diagram (erd)

Draw an entity relationship diagram (ERD) for the following situation: A company has a number of employees.  Each employee is identified by an Employee_Id.  The company wants to store Employee_Name, Employee_Address, and Employee_BirthDate in the dat..

  Implement a program to query and update the text database

Implement a program to query and update the text database for a library using a client/server model allowing multiple clients safe access to the database, and using a producer-consumer model to control the inventory of each item.

  Demodulator circuits and amplitude modulator

Explain how much the modulating signal power is required to generate 100 percent modulation? What is the approximate center frequency of filter required to pass the lower sideband?

  Converting user form into 1nf and 2nf

Complete database exercise by converting user form located the evaluation procedures section of the syllabus into 1NF and 2NF.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd