Skip to content
Snippets Groups Projects
Brandon Rodriguez's avatar
Brandon Rodriguez authored
b393fae3

Java & MySQL - Database Console Application

Description

A console application to manage a database for "Northwind Traders," a fictitious company which imports and exports specialty foods around the world.

Program is written in java, and the application only ends when the user chooses to quit.

To run, use the command "java -jar a4.jar" from within the root directory. If errors, see "Database Connection with Environment" section.

Project Requirements

Communicate the provided MySQL database schema, using plain text only. Must provide Menu Options for the following main functions:

* Add new customer.
* Add new order.
* Remove order.
* Ship a pending order.
* Print currently pending orders.
* Restock inventory.
* Exit.

When adding, updating, or deleting a value, all appropriate related fields should also be updated as well. Fields should also be checked for validation, and appropriate error-handling should be present. If ever in doubt, assume the project should behave "the way it works in the real world."

Notes

Provided database appears to have very little to no validation, prior to hand off. Thus, values may or may not make sense for what they should be. Furthermore, there is no additional documentation of fields within database, and some fields are named poorly. Thus, it is not always clear as to the purpose of a given field.

For example, the "orders" table has a field "Freight", which at first glance, seems like it might indicate a shipping method. In actuality, this field is essentially "ShippingCost" and should probably have been named accordingly. See Known Problems/Issues (below) for further field confusion notes.

Database Connection with Java Environment.

I'm not used to writing in java, and not sure how the language handles some parts of development. I want to say that the program can be exported into a single jar file, similarly to a C# console application, and all necessary dependencies will be included within.

However, I'm not positive if that is the case, and thus I'm not certain if the database-connection-libraries will be included. If there are any troubles connecting to the database (particularly java's weird forClass and Driver classes), then reference https://help.ubuntu.com/community/JDBCAndMySQL and possibly look into intellij's IDEA IDE (the development environment used to create the project).

Known Problems/Issues

Some fields related to orders, products, and shipping are extremely confusing and the general purpose of the field is ambigious. A big culprit of this is the "product" table's "UnitsOnOrder" field. Initially, I took this to be field to be related directly to shipping/ordering inventory. I thought it was meant to store the quantity of each product currently associated with pending orders.

I also thought that, once the order was shipped, the "UnitsInStock" and "UnitsOnOrder" field were supposed to decriment accordingly, based on how many of that product were just shipped.

However, this doesn't appear to be accurate, as there are a lot of ProductID's which have a quantity associated with a pending order, but do not actually have any values within the product's "UnitsOnOrder" field. The provided instruction pdf only even mentions specifications for printing of pending orders, so I'm not sure how to deal with this UnitsOnOrder field. I really don't understand what functionallity this field is supposed to provide.

An order's RequiredDate is also similar. There is no specification as to what the rules a RequiredDate should follow, so it is simply ignored and left null in all instances.

Similarly, the "category", "shippers", and "suppliers" tables are ignored as well. None of these tables have any immediately apperant use in relation to the project's requirements.