Question Details

(Solved) PROJECT 1: Simulate a Database Management System A. PROJECT SPECIFICATION This project is to build and implement an application on that emulates a...


Hello,

I need help finishing up my java coding project. I've managed to get most of done but I'm stuck on the last part of parsing in the strings from DBUSER.txt into Database.java. The DBUSER is a txt file that contains commands that will tell my Database class what commands it should call from the DBCommands class. I'm having trouble getting the specific coding down to be able to account for all file names but I did manage to get it to work for some of the commands. DBCommands is mostly finished in terms that it do what it needs to do, I just need to finish writing the error messages. The database pdf is everything i need to do for the project and how to complete it. It will give you a more in depth description.

In summary, I really just need help finishing the Database class and it you could give me a good explanation has to how you do it, that would be good. Also if you could help me complete the bonus commands. I'm almost done with the DELETE FROM but need help finishing and then also the  UPDATE command. Please help me with this, I've been stuck on it for a while and really need help finishing it. Thank you and please let me know if you have any questions.


PROJECT 1: Simulate a Database Management System
A. PROJECT SPECIFICATION This project is to build and implement an application on that emulates a simple SQL-like database
management system using linux files and directories. Your program will read records from a command
file, parse each record command and implement the DBMS features for each command. These commands
are design to build and remove the database, tables files and data. The database structures will be built
with commands such as create and drop. The data created, deleted, manipulated and queried with inserts,
updates, deletes and selects. All Errors must be trapped and stored in a .err file. All commands in the
command file must generate 1 or more status messages and store them in a log file. B. DESIGN FEATURES
- C. The Java application must compile and run on the nike linux server.
All files and directories must be created on nike under your home directory
“/home/ugrad/studentname/project1”
The app must use java file IO objects, not issuing direct linux commands such as mkdir,…
The app will have multiple tables and records within them.
The app may have more than one database.
All errors must be caught and processed (try...catch) (see chap 10 in the textbook). The error
message must include the original command in the error file.
E.g. (CREATE TABLE /bin/hacker/killnike)
All status messages must be logged in a log file. The status message must include the original
command in the status file. E.g. (CREATE TABLE college)
All Code must have comments (e.g. – explain each code block, IF, loop, method call,…)
All methods must have a comment block that includes (author, date, purpose, parameter
explanation)
You will be provided with an input test command file DBUSER.txt.
You will be provided with skeleton code:
o (1) a main driver “database.java” class file with hooks for opening and parsing the input
string from the DB.com command file,
o (2) Base class file “dbcommands.java” with hooks for API like methods. You will have to
fill in the code blocks. DATABASE/FILE DEFINITIONS
Database Entity
Database
Table
Status File and Implementation
Unix File Directory, exa: school
I/O data File in the DBMS directory, exa: students
Output status AND results from SELECT statements file in the DBMS
directory that keeps track of how each command implemented database
changes, exa: status.txt
- Store this file in your local home directory in nike
- The status message must include the original command in the
status file. Error Command file
File I/O stream
objects D. Output error message file in the DBMS directory that keeps track of the
error message resulting from commands that error, exa: error.txt
- Store this file in your local home directory in nike.
- The error message must include the original command in the
error file.
Input test file “DBUSER.txt” read in by application to emulate a user
issuing SQL-like commands to the database in order to build it. Store this
file in your local home directory in nike.
Study the API for the following Java objects to find out which methods
will best suite your program solution. Note, you will probably need to the
pass the constructor of a FILE object into PRINTWRITER or SCANNER to
allow for inheritance of a variety of file method operations.
- FILE
- SCANNER
- PRINTWRITER
- FILEWRITER
- EXCEPTION
- BUFFEREDWRITER
- BUFFEREDREADER DB SQL COMMANDS
1. SQL commands that change structures in a database are called Data Definition Language “DDL”
commands. We implemented with commands like create or drop. Java library objects and API
methods will be covered in class to assist in opening, closing and removing files and directories. Also,
Chap 10 in the textbook covers some of the issues with File I/O.
- Create a database (similar to the unix mkdir a directory)
Drop a database (similar to the unix rmdir a directory)
Create a table (open .tab file for write)
Drop a table (similar to the unix rm .tab filename) 2. SQL commands that manipulate data are called Data Manipulation Language “DML” commands
They include commands such as insert, update and delete data rows. Our code will implement this by
manipulating records in tables files.
- Insert rows into table (write records into .tab file)
Update rows in a table (read, change, delete old record, write new record
Delete rows in a table (read/locate, delete) 3. The SELECT command must be implemented in order to read information from our database table
files. E. COMMAND FILE FORMATs Command File record
CREATE DATABASE “dbname”
DROP DATABASE “dbname”
CREATE TABLE “dbname”.
“tablename”
DROP TABLE “dbname”.
“tablename”
INSERT “insertString”
INTO “dbname”. “tablename”
SELECT * FROM “dbname”.
“tablename”
WHERE COLUMN = “idvalue” F. SELECT * FROM “dbname”.
“tablename” Remove the “tablename.tab” file from the dbname directory
Exa: DROP TABLE college.students
Write the string into the table file as a record.
Exa: INSERT “John Smith” INTO college.students
Read * ‘all’ columns for a specific record “column” from the
tablename file based on its idvalue. Spool output to log file.
Exa: SELECT * FROM college.students
WHERE COLUMN = “John Smith”
*** Select format ****
SELECT column1
FROM table1
WHERE column1 = “idvalue” // row condition
Read * ‘all’ columns for ‘all’ records from the tablename file.
Spool output to log file. DELETE FROM “dbname”.
“tablename” Delete ‘all’ records from the tablename file.
Exa: DELETE FROM college.students BONUS COMMANDS (+10 bonus points: 5 pts per command)
DELETE FROM “dbname”.
“tablename”
WHERE COLUMN = “idvalue”
UPDATE “dbname”.
“tablename”
SET COLUMN = “newvalue”
WHERE COLUMN = “value” G. Definitions
Create a unix directory named dbname.
Exa: CREATE DATABASE college
Remove the unix directory named dbname.
Exa: DROP DATABASE college
Create a single column table file in the dbname directory
Exa: CREATE TABLE college.students Delete a specific record “column” from the tablename file based
on its idvalue.
Exa: DELETE FROM college.students
WHERE COLUMN = “John Smith”
Change a specific record based on its value for a specific table
file based on the strings.
Exa: UPDATE college.students SET COLUMN = “Jane Doe”
WHERE COLUMN = “John Smith” SUBMISSIONS Your java files must be place in a project1 directory and submitted on nike. For
example: login to nike and you should see the command prompt -bash-4.1$. To
submit your project (depending on which 1302 CRN you are in) use one of the
following submit commands: CRN 26245 TWR 9:30-10:45
submit project1 cs1302a
CRN 26311 TWR 3:30-4:45
submit project1 cs1302b

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Sep 05, 2019

PRICE: $15

Solution~000200069521.zip (25.37 KB)

Buy this answer for only: $18

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free solution (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Sep 05, 2019

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now