Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For the coding part, I'd like you to write a simple command line application RecordMeasurer.java to test properties of the record formats of Mysql and

For the coding part, I'd like you to write a simple command line application RecordMeasurer.java to test properties of the record formats of Mysql and sqlite. You can assume the grader has a recent version of Java (last 5 years -- but no particular guarantee other than that) installed. The grader will compile your code from the command line by switching into your folder, and entering the line:\ \ javac RecordMeasurer.java\ \ The top of your program's class file should have any constants the grader needs to tweak to make a JDBC connection to a Mysql DB or sqlite Db. In the case of sqlite, you should as part of your homework folder have a empty file test.sqlite with an empty sqlite database file. Your program will be run from the command line with a command like:\ \ java RecordMeasurer dbms db table_name type num_rows num_columns index_no_index\ \ Here dbms is the type of database management system to connect to (either mysql (even if use MariaDB) or sqlite); db is the database to connect to; table_name is a table to create if it doesn't already exists, and drop and create if it already exists; type is a SQL attribute of INTEGER, FLOAT, or VARCHAR(n), num_rows is the number of rows of random data to be generated, num_cols is the number of columns of that type each row should have, finally, index_no_index, is a boolean which says whether or not to make an index for the first column. An example set of inputs the grader might use is:\ \ java RecordMeasurer sqlite "test.sqlite" FOO "VARCHAR(39)" 10000 20 false\ \ This should create in the sqlite database in the file test.sqlite, a table FOO which has 20 columns each of type VARCHAR(39), and then do 10000 inserts of random rows (a random row means make a string of 39 chars out of characters "0" and "1") into this table. Similar ideas should be used for random INTEGER where you pick a random number between 0 and twice the number of rows, and random FLOAT where you pick a random float between -1.0 and 1. The false command line argument means your program should not make an index on the first column. A value of true would indicate that it should make an index on the first column.\ \ Once you have written this program I want you to do experiments where you vary the SQL type and the number of rows and columns and for each type try to determine (a) how many bytes the DBMS needs to use for a record header, (b) how many bytes in a record is used to store the given type on average, (c) how much overhead is an index record. To figure these out, you should locate the file on disk in which the table is stored and compare how the file size changes as you vary your programs parameters.\ \ Carefully, write up each experiment you conduct. Each experiment should have clearly stated, purpose, hypothesis, results, conclusion. Put these write-ups in the file Experiments.pdf, which should also be included in your Hw1.zip file submitted.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions