Вы находитесь на странице: 1из 6

CSCI 1301 PROJECT 1: Simulate a Database

Management System A. PROJECT SPECIFICATION


This project is to build and implement an application on
that emulates
To Purchase This Material Click below Link
http://www.tutorialoutlet.com/all-miscellaneous/csci-
1301-project-1-simulate-a-database-management-
system-a-project-specification-this-project-is-to-build-
and-implement-an-application-on-that-emulates

FOR MORE CLASSES VISIT


tutorialoutlet

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

Вам также может понравиться