Free Essay

Java Assignment 5

In:

Submitted By studentuta
Words 2288
Pages 10
BCIS 3680 Enterprise Programming Instructor: Dr. Andy Wu

Assignment 5

Part 1. Building Database In this part of our development of Music Galore, we will build the database to which the web front‐ end will connect. Create a MySQL database named (for example, CaseJ for Justin Case) and create the following tables. Database Schema 1. An album table to contain album information:
Field sku title genre label format Use SKU number of album Album title Genre of album Label (distributor) of album Media format of album (CD, CD+DVD, vinyl, etc.) Release date Price of album Data to Contain Integer, must have value, primary key String, up to 96 characters, must have value String, up to 50 characters String, up to 50 characters String, up to 24 characters

rlsdate price

Date value, in yyyy-mm-dd format Float

2. An artist table to contain information on singers, bands, producers, etc.
Field aid name1 name2 amgid url Artist ID Last name or name of band First name (if band, leave it blank) All Music Guide (allmusic.com) ID URL of artist’s official website Use Data to Contain Integer, must have value, primary key, auto-numbered String, up to 72 characters, must have value String, up to 50 characters String, up to 10 characters Large text field. Input should be limited to 2083 1 characters

1

The length limitation should be enforced programmatically. In MySQL script, simply use text datatype.

BCIS 3680 Enterprise Programming

Assignment 5 ‐ 1

3. A music table to contain individual pieces of music:
Field mid ID of music Use Data to Contain Integer, must have value, primary key, autonumbered String, up to 96 characters, must have value

title

Title of music

4. An associative table named musicalbum that relates music to an album, i.e., tracklist of the album:
Field sku SKU of album Use Data to Contain Part of primary key, foreign key referring to sku in album table Part of primary key, foreign key referring to mid in music table Part of primary key, integer, must have value

mid

ID of music

trackno

Track number (music is included in album as the #th track) Duration of track (in seconds)

duration

Integer

Notes: Don’t be too liberal with the use of auto‐numbered primary keys. Designate a primary key column as auto‐numbered only when instructed to do so. You are required to use char data type for textual data (string) here. However, it’s recommended that you read about the varchar datatype and know the pros and cons of the two textual datatypes. In these assignments, foreign key relationships and constraints will not be enforced in MySQL, due to the recommended MyISAM engine. You may optionally enforce referential integrity in JSP code. Database Scripts Write a script (create.sql) to create the tables. To make testing your script easier, it is recommended that you have these lines at the top of your script: drop table musicalbum; drop table artist; drop table album; drop table music; These lines will undo whatever previous effort you made to create and populate the tables. It wipes everything clean in the database so previous data won’t get in your way. Follow these lines with your scripts to create the above mentioned tables.

BCIS 3680 Enterprise Programming

Assignment 5 ‐ 2

Write another script (populate.sql) to populate the tables. Note that the information below is presented in a way that is friendly to human readers, not to MySQL. Many parts of it may not be in a format that is compatible with the data types of table columns. If that’s the case, you want to make proper modifications before you enter them into the VALUES clauses. In particular, if an entity (e.g., album, music) is described below in textual form while in the table it’s represented as a foreign key, you should look up the primary key of the entity in its own table and enter it into the focal table as a foreign key. 1. In the album table, add the following albums (not necessarily my favorites) and their primary keys and related information:
217001, Falling Into You, Rock, 550 Music/Epic, CD, Mar. 12, 1996, 6.99 217008, Use Somebody, Rock, RCA, CD, Dec. 8, 2008, 10.99 217015, I Am… Sasha Fierce, R&B, Sony, CD, Nov. 18, 2008, 12.49 217022, Braveheart, Soundtracks, PolyGram, CD, Oct. 7, 1997, 7.99 217029, Dangerously in Love, R&B, Columbia, CD, Jun. 24, 2003, 9.95 217036, The Very Best of Mozart, Classical, Naxos, CD, Oct. 18, 2005, 11.99 217043, Avatar, Soundtracks, Atlantic, CD, Dec .15, 2009, 12.95 217050, Wolfgang Amadeus Phoenix, Rock, Glass Note, Vinyl, May 25, 2009, 17.99 217057, Faith, Rock, Sony, CD+DVD, Jan. 1, 1987, 19.95

2. In the artist table, add the following artists (not necessarily my favorites) and their primary keys and other information. (Note: If URL is not available, the field should contain null.)
1, James Horner, q7470, no URL, 2, London Symphony Orchestra, q37333, http://lso.co.uk 3, Beyonce, p349078, http://www.beyonceonline.com 4, Wolfgang Amadeus Mozart, q7754, no URL 5, Celine Dion, p4099, http://www.celiondion.com 6, Kings of Leon, p554165, http://www.kingsofleon.com/home 7, Bob Marley, p2907, http://www.bobmarley.com 8, Phoenix, p401761, http://www.wearephoenix.com 9, Pet Shop Boys, p5135, http://www.petshopboys.co.uk 10, George Michael, p4909, http://www.georgemichael.com

3. In the music table, add the following songs and their primary keys. (Note: Apostrophes in music titles must be part of the value stored; hint – use escape sequence.)
10001, It’s all coming back to me 10002, Because you loved me 10003, Falling into you 10004, Make you happy 10005, Seduces me 10006, All by myself 10007, If I were a boy 10008, Halo 10009, Disappear 10010, Broken-hearted girl 10011, Ave Maria 10012, Satellites

4. In the musicalbum table, add the following association between music and albums:
Falling Into You, It’s all coming back to me, Track #1, 457 seconds Falling Into You, Because you loved me, Track #2, 273 seconds Falling Into You, Falling into you, Track #3, 258 seconds Falling Into You, Make you happy, Track #4, 271 seconds Falling Into You, Seduces me, Track #5, 226 seconds

BCIS 3680 Enterprise Programming

Assignment 5 ‐ 3

Falling Into You, All by myself, Track #6, 312 seconds I Am…Sasha Fierce, If I were a boy, Track #1, 249 seconds I Am…Sasha Fierce, Halo, Track #2, 261 seconds I Am…Sasha Fierce, Disappear, Track #3, 267 seconds I Am…Sasha Fierce, Broken-hearted girl, Track #4, 277 seconds I Am…Sasha Fierce, Ave Maria, Track # 5, 222 seconds I Am…Sasha Fierce, Satellites, Track #6, 187 seconds

Part 2. Web Pages Now you will actually build the dynamic pages on the Music Galore site. You will modify the existing music.jsp (from Assignment 4) and create two more JSP files: artists.jsp and albumdetail.jsp. Also, you will create two HTML files: header.htm and footer.htm. You must have these navigation links at the top of each page. Leave the Contact Us, and Help links inactive. If you prefer the underlined, hyperlinked look, you may set their href property to #.
Hyperlink Text Home Albums Artists Destination default.jsp music.jsp artists.jsp Hyperlink Text Contact Us Help Destination None or # None or #

1. Make a copy of your deployment folder for Assignment 4 and rename it for Assignment 5. 2. Build a header file called header.htm that contains the above navigation links. Then, build a footer.htm file that contains a link to the Media Galore home page (default.jsp) and copyright notice. Every new JSP file should include the header and footer. The title bars of the JSPs should be specific to the nature of the page, instead of a generic title. 3. The music.jsp page lists all albums in the database:

BCIS 3680 Enterprise Programming

Assignment 5 ‐ 4

Specifications of this page: For each album, display the regular price from the database column price. In addition, in the HTML table, display another column for Sales Price. The sales price for each album is 80% of the regular price. Both regular and sales prices must be displayed in the currency format (with dollar sign and two places after the decimal point). For each album, add a radio button at the beginning of its row. Set the value attribute of the radio button to the SKU of that album. Name the radio button group selSKU. This sets up the radio buttons for what we will do in Assignment 6. No further coding is needed at this point. Tip: Create a DecimalFormat object and use the proper display mask for the price figures. 4. The title of each album is displayed as a hyperlink. When clicked, a page (albumdetail.jsp) should appear and display some information on the album. For example, clicking the title Falling Into You on music.jsp causes the following page to be displayed:

Specifications of this page: The title bar displays the title of the album. The top portion of this file displays the summary information of the album: title, label, genre, and release date. Note that the release date is displayed in full, and the three parts (year, month, and day) are separated by two slashes (/), not dashes (‐). The bottom portion is a listing of tracks in the album (for simplicity we display only six tracks).

BCIS 3680 Enterprise Programming

Assignment 5 ‐ 5

For each track, display its track number in the album (as recorded in the musicalbum table), title, and duration. If a track title contains an apostrophe (e.g., It’s All Coming Back to Me), it should be displayed. Note that the duration is displayed in the mm:ss format. If the number in the seconds part is less than ten, there is a leading zero in front of it (e.g., the “09” part in the first track). However, even if the minutes part is less than ten minutes, there is no leading zero. Tip: To convert duration in seconds to the #:## format, after you retrieve the duration value from the musicalbum table, divide it by 60 and round the result to obtain the minutes part. Then run a modulus operation on the duration value to obtain the seconds part.

5. Clicking the Artists link displays artists.jsp, which shows all entries in the artist table:

Specifications of this page: If an artist has both a first name and a last name (e.g., Celine Dion), his/her name must be displayed in the order of first name followed by last name. If the artist is a band or orchestra, its name as entered in the name1 field in the table should be displayed. The list must be sorted by last name/band name in alphabetic order, as shown above. The Artist ID: line displays the artist’s ID as stored in the aid column in the artist table. The AllMusic Page: line shows the URL to the artist’s biography page on the All Music Guide website. This URL follows a standard format: http://www.allmusic.com/ artist/-. The part is the artist’s full name, with all parts connected by hyphens. For example, it is kings-of-leon for Kings of Leon;

BCIS 3680 Enterprise Programming

Assignment 5 ‐ 6

wolfgang-amadeus-mozart for Mozart, and so on. Replace the part with the value you retrieve from the amgid column in the artist table. The Official Website: line shows the URL of an artist’s official website, Facebook page, fan site, etc., if available. The value comes from the url column in the artist table. If for an artist that column contains no information, then this line, including the Official Website: heading, does not appear at all. For example, notice the difference between James Horner (without URL) and Kings of Leon (with URL):

Clicking the AllMusic link opens up the artist bio page in a separate window (the default setting in Firefox is to open in a new tab):

Tip: To generate the part of the AllMusic link, use the replace() method of the String class and replace the spaces in names with hyphens. One version of the method takes two parameters, a char that stands for the character to be replaced and another char as the replacement character. Similarly, clicking the Website link opens the site in a new window/tab:

BCIS 3680 Enterprise Programming

Assignment 5 ‐ 7

Preparing Your Submission In the deployment/submission folder, include your database data files and scripts that created them. In your Assignment 5 submission folder, add a database subfolder. In your mySQL data folder (which you set as the value of the datadir attribute in the my.ini configuration file), locate your data folder for the assignment, e.g., Justin Case has these contents in his (note there are three files for each table, plus a file called db.opt):

Go up one level, copy this folder, as well as the mysql folder. Paste both folders into the database folder you created earlier. Also include in this folder the two scripts – create.sql and populate.sql. After you have done the above, your database subfolder will contain two files and two subfolders, similar to Justin’s below:

BCIS 3680 Enterprise Programming

Assignment 5 ‐ 8

You submission folder now looks something like this (except artistdetail.jsp, which is not required in this assignment):

Submission Due Date: Fri., Nov. 30, 2012 (11:59 PM) Submission Requirements: No hard copy is required. Zip your submission folder into BCIS3680-Assignment5-YourLastNameYourFirstName.zip (RAR is fine too). Submit the zip file as an attachment on Blackboard.

BCIS 3680 Enterprise Programming

Assignment 5 ‐ 9

Similar Documents

Free Essay

This Is a Syllabus

...Read: Karel, Chapters 4-6 October 2 4 Control statements Boolean expressions Introduction to Java Variables, values, and types Classes and objects Arithmetic expressions The Program class hierarchy Read: Java, Chapters 1-2 7 Methods Using parameters Read: Chapter 3 9 More parameters Pseudorandom numbers The RandomGenerator class Read: Chapter 4 Due: Assignment #1 11 Creating classes Stylistic expectations Using javadoc Read: Chapter 5 14 Read: Chapter 6 16 18 Character data The Java String class The acm.graphics package More graphics The collage graphics model Event driven programming Read: Chapter 9.1-9.3 Due: Assignment #2 21 Read: Chapter 9.4 Read: Chapter 10.1–10.4 23 Read: Chapter 8.1-8.4 25 File processing Exception handling String manipulation Objects and memory Problem-solving with strings More on parameter passing Read: Chapter 8.5 Read: Chapter 7 Due: Assignment #3 Read: Chapter 12.4 –2– Monday 28 Arrays and ArrayList 30 Arrays and ArrayList (continued) Wednesday Friday November 1 Belated midterm recovery day (No class) Read: Chapter 11.1-11.8 Tuesday, October 29th 7:00-9:00pm: Midterm 4 6 Debugging strategies Java collections framework The HashMap class Iterators Object-oriented design Read: Chapter 13 13 Component listeners Data structure design 8 Swing interactors The JComponent hierarchy Action listeners Due: Assignment #4 11 Graphical user interfaces Interactors Read: Chapter 10.5–10.6 15 Sorting and searching...

Words: 409 - Pages: 2

Free Essay

With the Development of Technology, More and More Robots Are Used in Various Fields,

...University of Mumbai B.E Information Technology Scheme of Instruction and Evaluation Third Year -Semester VI Scheme of Instructions Sr. Subjects Lect/ No 1 Information and Network Security Middleware and Enterprise Integration Technologies Software Engineering Data Base Technologies Programming for Mobile and Remote Computers Information Technology for Management of Enterprise TOTAL Week 4 Scheme of Examinations Theory T/W Practical Oral Total Hours Marks Marks Marks Marks Marks 3 100 25 -25 150 Pract/ Week 2 Tut/ Week -- 2 4 2 -- 3 100 25 -- 25 150 3 4 5 4 4 4 2 2 2 ---- 3 3 3 100 100 100 25 25 25 --25 25 25 -- 150 150 150 6 4 24 10 1 1 3 -- 100 600 25 150 -25 25 125 150 900 INFORMATION AND NETWORK SECURITY CLASS T.E. ( INFORMATION TECHNOLOGY) HOURS PER LECTURES : WEEK TUTORIALS : PRACTICALS EVALUATION SYSTEM: THEORY PRACTICAL ORAL TERM WORK : SEMESTER VI 04 -02 HOURS 3 ---- MARKS 100 25 25 1. Introduction What is Information Security? Security Goals. 2. Cryptography Crypto Basic, Classic Cryptography, Symmetric Key Cryptography: Stream Ciphers, A5/1, RC4, Block Ciphers, Feistel Cipher, DES, Triple DES, AES, Public Key Cryptography: Kanpsack, RSA, Defiie-Hellman, use of public key crypto- Signature and Non-repudiation, Confidentiality and Non-repudiation, Public Key Infrastructure, Hash Function: The Birthday Problem, MD5, SHA-1, Tiger Hash, Use of Hash Function. 3. Access...

Words: 3868 - Pages: 16

Free Essay

Dnfkdsfnklff

...CertPrs8/OCA/OCP Java SE 7 Programmer I & II Study Guide (Exams 1Z0-803 & 1Z0-804)/Sierra/177200-6/FM CONTENTS AT A GLANCE Part I OCA and OCP 1 Declarations and Access Control .............................. 3 2 Object Orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 3 Assignments 4 Operators 5 Working with Strings, Arrays, and ArrayLists .................... 257 6 Flow Control and Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 .............................................. 165 ................................................ 223 Part II OCP 7 Assertions and Java 7 Exceptions ............................. 377 8 String Processing, Data Formatting, Resource Bundles . . . . . . . . . . . . . . 417 9 I/O and NIO 477 10 Advanced OO and Design Patterns 11 Generics and Collections .............................................. ............................ 541 .................................... 573 12 Inner Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681 13 Threads 713 14 Concurrency 15 JDBC A About the CD Index .................................................. .............................................. 785 ................................................... 841 .....

Words: 2596 - Pages: 11

Free Essay

It 238 Complete Class

...Week 1 DQs IT 238 Week 2 Assignment: Case Project 3–1 IT 238 Week 3 CheckPoint: JavaScript™ Code for Error Handling- Appendix C IT 238 Week 3 DQs IT 238 Week 4 CheckPoint: JavaScript™ Objects- Appendix D IT 238 Week 4 Assignment: DOM IT 238 Week 5 Assignment: Case Project 5–3 IT 238 Week 5 DQs IT 238 Week 6 CheckPoint: Project 6–3 IT 238 Week 6 Assignment: Project 7–3 IT 238 Week 7 DQs IT 238 Week 7 CheckPoint: Final Project Design Document- Appendix B IT 238 Week 8 CheckPoint: Java™ Applet IT 238 Week 8 Assignment: Case Project 11–4 IT 238 Capstone Activity mode aims to provide quality study notes and tutorials to the students of IT 238 COMPLETE CLASS in order to ace their studies. IT 238 COMPLETE CLASS To purchase this visit here: http://www.activitymode.com/product/it-238-complete-class/ Contact us at: SUPPORT@ACTIVITYMODE.COM IT 238 COMPLETE CLASS IT 238 Week 1 CheckPoint # 2: Project 2–8 IT 238 Week 1 DQs IT 238 Week 2 Assignment: Case Project 3–1 IT 238 Week 3 CheckPoint: JavaScript™ Code for Error Handling- Appendix C IT 238 Week 3 DQs IT 238 Week 4 CheckPoint: JavaScript™ Objects- Appendix D IT 238 Week 4 Assignment: DOM IT 238 Week 5 Assignment: Case Project 5–3 IT 238 Week 5 DQs IT 238 Week 6 CheckPoint: Project 6–3 IT 238 Week 6 Assignment: Project 7–3 IT 238 Week 7 DQs IT 238 Week 7 CheckPoint: Final Project Design Document- Appendix B IT 238 Week 8 CheckPoint: Java™ Applet IT 238 Week 8 Assignment: Case Project 11–4 IT 238...

Words: 517 - Pages: 3

Free Essay

Syllabus

...turn everything back off. During the lab portion of class [the last hour] you may have your laptops turned on to do BCIS 3630 work, or you may work in the COB computer labs. Please do not distract your classmates!! COURSE WEBSITE http://www.coba.unt.edu/itds/courses/bcis3630/bcis3630.htm Instructor: Dr. Guynes Office: BLB 312H Phone: (940) 565-3110 Office Hours: By Appointment Email: steve.guynes@unt.edu TEXTBOOK: Starting Out with JAVA, 5th Edition, by Tony Gaddis ISBN:0-132-85583-6 buy at bookstore or at Amazon: http://www.amazon.com/Starting-Out-Java-Control-Structures/dp/0132855836/ref=la_B001I9Q67I_1_3?ie=UTF8&qid=1344106024&sr=1-3 COURSE OBJECTIVES: This course is an introduction to business computer programming and design in a corporate environment. The primary focus is on the information systems function in support of corporate activities. Students will learn business problem solving using JAVA PROGRAMMING in a microcomputer environment. JAVA TOPICS COVERED JAVA program types, creating an application, applets, syntax, variables, literals and identifiers, methods, expressions, swing, , print, println. primitive data types, arithmetic operators, cast operation, final, string class, dialog boxes, joptionpane, scope, scanner class methods, , decision structures, if-else, relational operators, nested ifs, logical operators, precedence, switch and the case...

Words: 1870 - Pages: 8

Premium Essay

Bout This

...Pasig campus pangilinan DSITI-AI Oct 27 15 Java Programming java programming Introduction in java programming Objectives * Object-Oriented Programming Language * Object-Oriented Programming Principle * Benefits Of Object-Oriented Programming * Introduction To Java Programming * Resources Used To Create a Java Programming *Structures Of a Java Programming * Result Of Executing The Java Programing Object Oriented Programming Language (OOPL) OOPL Is An Extension Of Procedural Language. Involves Creating Program Components as Object Related To The Real Word. Writing Object-Oriented Programs Involves Creating Object And Application That Uses Those Objects. An Object Contains Both Data Procedures Can be packaged Into a Single Unit. Based On Three Concepts Encapsulation Ability To Bind Data And Procedures Into an Object. Inheritance Ability Of Objects To Acquire The Attributes Or Behavior Of Other Objects Or Classes. Polymorphism Ability of An Object To Take Many Forms Or Identities. Benefits Of Object-Oriented Programming *Reusability -Able To Reuse The Defined Objects. *Adaptability –Able to fit in different environment. *maintainability –Able to change easily. *reliability –Able to operate...

Words: 1445 - Pages: 6

Premium Essay

Java Programming Language Sl-275

...Sun Educational Services Java Programming Language SL-275 Sun Educational Services Java Programming Language September 1999 Copyright 1999 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun Logo, Solstice, Java, JavaBeans, JDK, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and Sun Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the...

Words: 6064 - Pages: 25

Free Essay

Its 320

...HELPIDO.COM ----------------------------------------------------------------------------------- FOLLOW THIS LINK TO GET THE TUTORIAL http://helpido.com/java-its320-critical-thinking-assignment-2-java-program-2-of-6-70-points-custom-bankaccount-class-with-a-modified-constructor-1-enter-the-code/ ----------------------------------------------------------------------------------- Java – ITS320 – Critical Thinking Assignment #2 Critical Thinking Assignment #2: Java Program #2 of 6 (70 Points) Custom BankAccount Class with a Modified Constructor 1) Enter the code for the two classes “BankAccount.java” and “Program2.java” shown below. The Program2 class is a driver for the BankAccount class. Note that this version of the BankAccount class accepts a monthly interest rate in decimal format which must be calculated by the user. /** * BankAccount class * This class simulates a bank account. * * (Taken from “Starting Out with Java - Early Objects * (Third Edition) by Tony Gaddis, 2008 by Pearson Educ.) * */ public class BankAccount { private double balance; // Account balance private double interestRate; // Interest rate private double interest; // Interest earned /** * The constructor initializes the balance * and interestRate fields with the values * passed...

Words: 1186 - Pages: 5

Free Essay

Declarations & Operatorsinjava

...Reference Variables Java Identifiers All the Java components - classes, variables, and methods need names. In Java these names are called Identifiers – Identifiers are representing the names of variables, methods, classes, etc. – Examples of identifiers are: employee_id, main, System, out. – Java identifiers are case-sensitive. This means that the identifier ‘employee_id’ is not the same as Emplyoee_ID. – Identifiers must begin with either a letter, an underscore “_”, or a dollar sign “$”. Letters may be lower or upper case. Subsequent characters may use numbers 0 to 9. – Identifiers cannot use Java keywords like class, public, void, etc. Examples of legal identifiers: int _id; double $c; long employee_id; Java Identifiers Coding Guidelines for Classes, Methods & Variables 1. For names (identifiers) of classes, capitalize the first letter of each word of the class name. For example, MyFirstJavaClass 2. For names (identifiers) of methods and variables, the first letter of the word should start with a small letter. For example, myFirstMethod Variable A variable is an item of data used to store the state of objects. A variable has a: – data type The data type indicates the type of value that the variable can hold. – name The variable name must follow rules for identifiers. Java Keywords Keywords are predefined identifiers reserved by Java for a specific purpose.You cannot use kywords as names for your variables, classes, methods ... etc. Page 1 List of Java Keywords abstract...

Words: 3710 - Pages: 15

Premium Essay

Nt1310 Unit 1 Assignment 1

...CIS 611: ENTERPRISE DATABASE SYSTEMS AND WAREHOUSING LAB ASSIGNMENT-2 NAME: KESHAV YERRA CSU ID: 2670843 Simulating a Simple Query Processor that evaluates a SQL Query in SelectFrom-Where Specification: This Simple Query Processor is created in order to read an input file and perform the necessary operations specified in that file and obtain the output. As this is a Simple Query Processor we can access only EMPLOYEE and DEPARTMENT tables because the classes are predefined by the user. JDBC/ODBC call is used to fetch the data of tables from SQL Server and the code is written in JAVA. We are using the tables which are created in Lab Assignment 1 in the COMPANY Database. Design & Implementation: First we need to create an input file which contains the execution steps. I have created an input file as “inputfile.txt” which contains the following text: Selection EMPLOYEE DNO=5 EMPS_DNO5 Join EMPS_DNO5 DEPARTMENT DNO=DNUMBER EMP_DEPT_DNO5 Projection EMP_DEPT_DNO5 Fname, Lname, SSN, Dno, Dname EMP_DEPT_ MGR_DEPENDENT Here there are three important cases which are: Selection Join Projection The main aim...

Words: 767 - Pages: 4

Premium Essay

Java

...Software Design Introduction to the Java Programming Language Material drawn from [JDK99,Sun96,Mitchell99,Mancoridis00] Software Design (Java Tutorial) © SERG Java Features • “Write Once, Run Anywhere.” • Portability is possible because of Java virtual machine technology: – Interpreted – JIT Compilers • Similar to C++, but “cleaner”: – No pointers, typedef, preprocessor, structs, unions, multiple inheritance, goto, operator overloading, automatic coercions, free. Software Design (Java Tutorial) © SERG Java Subset for this Course • We will focus on a subset of the language that will allow us to develop a distributed application using CORBA. • Input and output will be character (terminal) based. • For detailed treatment of Java visit: – http://java.sun.com/docs/books/tutorial/index.html Software Design (Java Tutorial) © SERG Java Virtual Machine • Java programs run on a Java Virtual Machine. • Features: – – – – – Security Portability Superior dynamic resource management Resource location transparency Automatic garbage collection Software Design (Java Tutorial) © SERG The Java Environment Java Source File (*.java) Java Compiler (javac) Java Bytecode File (*.class) Java Virtual Machine (java) Software Design (Java Tutorial) © SERG Program Organization Source Files (.java) Running Application Running Applet JAVA BYTECODE COMPILER Class Files (.class) JAVA VIRTUAL MACHINE WEB BROWSER Software Design (Java Tutorial) © SERG Program Organization Standards •...

Words: 5230 - Pages: 21

Premium Essay

Java for Dummies

...Programming Languages/Java ™ Jumpin’ Java! The bestselling Java beginner’s book is now fully updated for Java 7! Open the book and find: ava J • Definitions of the many terms you’ll encounter ® • The grammar of Java • How to save time by reusing code • All about if, for, switch, and while statements • An overview of object-oriented programming • Building blocks — learn to work with Java classes and methods and add comments • Hints about handling exceptions • How to write Java applets ® • The Java scoop — get an overview of Java, the enhancements in Java 7, and the software tools you need • Get loopy — understand the value of variables and learn to control program flow with loops or decision-making statements 5th Edition 5th Edition Java Java, the object-oriented programming language that works on almost any computer, is what powers many of those cool multimedia applications. Thousands have learned Java programming from previous editions of this book — now it’s your turn! Whether you’re new to programming or already know a little Visual Basic or C++, you’ll be doing Java in a jiffy. g Easier! Making Everythin • Ten ways to avoid mistakes • Class it up — explore classes and objects, constructors, and subclasses, and see how to reuse your code • A click ahead — experiment with variables and methods, use arrays and collections to juggle values, and create programs that respond to mouse clicks Learn...

Words: 34460 - Pages: 138

Free Essay

Researching Variable Naming Rules

...PT 1420 Unit 2 Research Assignment 1 12/28/2013 Unit 2 Research Assignment 1: Researching Variable Naming Rules Variable Naming Rules of Visual Basic * The first character must be a letter. * The usage of spaces, period (.), comma (,), Exclamation mark (!), or the characters @, &, $, # in the variable name are not allowed, but the underscore (_) is a valid character. * The name must be less than 256 characters in length. * You cannot use any names that are the identical as the functions, statements, and methods in Visual Basic. Variable Naming Rules of Python * The first character of the variable name must begin with a letter (a – z, A – Z), or an underscore (_). * The name can only consist of letters, numbers, and underscores (no special characters). * Variable names are case sensitive. * The variable name cannot be identical as a reserved name in Python due to the fact that Python uses them for other things. Variable Naming Rules of Java * Variable names are case sensitive. * A variable name can be any length as long as it is within the Unicode letter and digit standard, also you should use a letter as the first character of the variable word. You are allowed to use the dollar sign or underscore ($, _ ) as a first character but it isn’t recommended. * The only characters other than letters and number that can be used is the dollar sign and underscore (“$”, “_”), and no other special characters may be allowed. * If...

Words: 702 - Pages: 3

Premium Essay

Developer

...Programming--Malone Basics of Java Programming (A Work In Progress) What Constitutes a Java Program? A Java program consists of one or more source files. Each source file is called .java, where is the name of the class contained in that source file and .java is the extension that identifies the file as a Java source code file. In general, each source file contains one class. The name of the class must match the name of the file (without the extension) exactly. To execute a Java program, you first need to compile the source code into byte code. Byte code files have the name .class. If you’re working from the shell, this is done using the javac command (where “c” is for compiler). Usually we will be compiling using the Xcode IDE. Once compiled, the program is executed using the Java interpreter (a.k.a. the Java Virtual Machine or JVM). From the shell, the JVM is invoked with the “java” command. Again we will usually be doing this with the Build and Go or Debug options of the Xcode IDE. A Java program must have a routine called main(), which is the starting point for program execution. main() will always look something like this: public static void main (String args[]) { // insert code here... System.out.println("Hello World!"); } Source Code Formatting Keep in mind the following when writing Java source code: Java is case sensitive (“foo”, “Foo”, and “fOO” are all considered to be different in Java). • Every line of code in Java must end in a semi-colon (“;”). • Java doesn’t care about white...

Words: 968 - Pages: 4

Free Essay

Programming Assignment 1

...ASSIGNMENT 1 COMP-202, Fall 2014, All Sections Due: September 19th , 2014 (23:59) Please read the entire pdf before starting. You must do this assignment individually and, unless otherwise specified, you must follow all the general instructions and regulations for assignments. Graders have the discretion to deduct up to 10% of the value of this assignment for deviations from the general instructions and regulations. These regulations are posted on the course website. Be sure to read them before starting. Question 1: Question 2: Question 3: 60 points 20 points 20 points 100 points total It is very important that you follow the directions as closely as possible. The directions, while perhaps tedious, are designed to make it as easy as possible for the TAs to mark the assignments by letting them run your assignment through automated tests. While these tests will not determine your entire grade, it will speed up the process significantly, which will allow the TAs to provide better feedback and not waste time on administrative details. Plus, if the TA is in a good mood while he or she is grading, then that increases the chance of them giving out partial marks. Marks can be removed if comments are missing, if the code is not well structured, or if your solution does not follow the assignment specifications. Assignment Question 1: Scratch Project (60 points) You are to head to http://scratch.mit.edu/ and create an account. Start by exploring some projects, and click on the see...

Words: 1417 - Pages: 6