Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EECS 484 DISCUSSION 3 INTRODUCTION TO PROJECT 2 OUTLINE   New 12 table design   Access to Private/Public Data   Overview (JDBC)   Java Files   Example Query   9 Tasks   Execution, Submission, Grading New 12 table design   USERS   EDUCATION   FRIENDS   USER_EVENTS   CITIES   PHOTOS   PROGRAMS   ALBUMS   USER_CURRENT_CITY   TAGS   USER_HOMETOWN_CITY   PARTICIPANTS Access to Private Data   Using 5 tables created from http://apps.facebook.com/eecs_facebookdata   SQL > @CreateTablePrivate.sql;   SQL> @PopDataPrivate.sql;    Will generate 12 tables in your oracle account with your Facebook data.   SQL> @grantAccessPrivate.sql;    Will give JDBC access to select data from your tables.   SQL> @DropTablePrivate.sql;    Drops 12 tables. Access to Private Data   <prefix>.<Data Type>_<TABLE_NAME>   prefix  ­ your oracle account name   Data Type – “PERSONAL”   TABLE_NAME – 12 table names   (i.e. YourAccountName.PERSONAL_USERS) Access to Public Data   <prefix>.<Data Type>_<TABLE_NAME>   prefix  ­ heedokim   Data Type – “PUBLIC”   TABLE_NAME – 12 table names   (i.e. heedokim.PUBLIC_USERS) Overview JDBC An API to access a DBMS from an application: •  Connect to a DBMS •  Send queries and update statements to the database •  Retrieve and process the results received from the database Java Files   TestFacebookOracle.java    Only modify 3 lines below:   FacebookOracle.java    Do not modify this file!!   MyFacebookOracle.java    Modify prefix to switch between public & personal data    Fill in the rest of body ONLY!    Use the corresponding variable when referring to a table Example Query   MyFacebookOracle.java contains Query 0 and skeleton codes for Query 1 ­9 9 Tasks (displaying first 2)   Query1 (10 points): Find information about names The next query asks you to find information about user names, including (1) The longest last name, (2) The shortest last name, and (3) The most common last name. The following code snippet illustrates the data structures that should be constructed. However, it is up to you to add your own JDBC query to answer the question correctly.   Query2 (10 points): Find “lonely” friends The next query asks you to find information about all users who have no friends in the network. Again, you will place your results into the provided data structures. The sample code in MyFacebookOracle.java illustrates how to do this. Execution   Oracle JDBC Driver (ojdbc6.jar).    This driver requires Java JDK 1.6.   Using the Eclipse:    Create a package called ‘project2’    Add 3 java files to the package    Go to 'Project Settings' then 'Java Build Path', then click on the 'Libraries' tab, then 'Add External JAR'. Execution   Using the editor:    Create a directory called 'project2‘    Add 3 Java source files in this directory.    Compile:   javac project2/FacebookOracle.java   javac project2/MyFacebookOracle.java   javac project2/TestFacebookOracle.java    Run:   java  ­cp "/path/to/ojdbc6.jar:" project2/TestFacebookOracle   (/path/to/ is the path to the directory of ojdbc6.jar file) Submission   Turn in your code via CTools.    Create a single folder “Project_2” containing:   MyFacebookOracle.java   This should contain all of your code for queries 0 ­9, and should run with an unmodified version of FacebookOracle.java   Zip the folder, producing the single file “Project_2.zip” to submit. Grading   9 Query tasks – 90 points   Java/SQL programming style – 10points    Try to do most of work inside the sql not in Java.   (This will be actually easier for you to implement) ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online