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

  Create a database to control its local libraries

A county wishes to create a database to control its local libraries. Each library has a number of employees, one of whom is designated as the manager of the library and is responsible for supervising employees and the general day-to-day management..

  Creates a database named personnel

Write an application that creates a database named Personnel. The database should have a table named Employee, with columns for employee ID, named position, and hourly pay rate.

  1 explain the concept of physical data independence and its

1. explain the concept of physical data independence and its importance in database systems2. explain what problems are

  Sort ascending by consultant id and date opened

Sort ascending by consultant ID and Date Opened. Don't show tickets with category ID of 0. HINT: You will require to use SELECT query with an alias in builder for the column.

  Vehiclerentaloz data warehousevehiclerentaloz is a large

vehiclerentaloz data warehousevehiclerentaloz is a large chain of vehicle rental company over 500 stores distributed

  As a dba it is vital that you understand in detail how a

as a dba it is vital that you understand in detail how a query is processed by the dbms. since team retail is using

  How much overhead cost would be assigned to product

How much overhead cost would be assigned to Product U94W using the activity-based costing system - How much overhead cost would be assigned to Product K91B using the activity-based costing system

  Explain how to create query in access query wizard

Describe how to create a query in Access Query Wizard equilvant to the query: SELECT first, last, department, hours FROM payroll WHERE hours>.

  Create stored procedure to updates members balance

Create a stored procedure that updates the members' balance in the membership table by correctly recording the current or outstanding balance for each customer.

  Configuring the authentication mode in ssms

Launch SSMS - Right-click on the SQL Server instance you want to configure and select Properties - you will configure the authentication mode for the SQL Server instance. You will ensure that the authentication mode is set to mixed mode so that the..

  What is the goal of computer forensics

From your knowledge and experience how are computer forensic investigators, in today's world of complex technology, are able to retrieve and analyze data that can be used in computer forensic investigations.

  Primary task responsenbspwithin the discussion board area

primary task responsenbspwithin the discussion board area write 400-600 words that respond to the following questions

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