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

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

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