Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 157B: Database Management Systems II April 29 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.

Similar presentations


Presentation on theme: "CS 157B: Database Management Systems II April 29 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak."— Presentation transcript:

1 CS 157B: Database Management Systems II April 29 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak www.cs.sjsu.edu/~mak

2 Department of Computer Science Spring 2013: April 29 CS 157B: Database Management Systems II © R. Mak 2 Midterm Solution: Question 1 a. The measures in the Orders fact table are quantity, revenue, and profit. b. It is not necessary to normalize a dimension table, so the Product table should be left alone.

3 Department of Computer Science Spring 2013: April 29 CS 157B: Database Management Systems II © R. Mak 3 Midterm Solution: Question 2 a. There are many possibilities for measures, depending on what you want for fact tables. The grain of each measure would depend on how “deep” are the hierarchies of the dimensions, such as down to each class per semester per campus. Examples:  Students: level, major, grade, expenses  Faculty: level, number of classes, number of students  Campus: number of students, graduation rate, tuition _

4 Department of Computer Science Spring 2013: April 29 CS 157B: Database Management Systems II © R. Mak 4 Midterm Solution: Question 2

5 Department of Computer Science Spring 2013: April 29 CS 157B: Database Management Systems II © R. Mak 5 Midterm Solution: Question 3 a. Drill down from school year to semester. b. Drill up from department to school. c. Slice: view data from a single campus. d. Dice: view data from several departments in several campuses e. Pivot: view data campus X year vs. year X campus _

6 Department of Computer Science Spring 2013: April 29 CS 157B: Database Management Systems II © R. Mak 6 Midterm Solution: Question 4 a. The are many forecasts that predictive analytics can make. For example:  student enrollment  grade point average  graduation rate  tuition income  Some possible patterns:  Characterization: What types of students do well in data mining classes?  Clustering: Foreign students take more technical courses.  Evolution: How computer science courses change over time.  Classification: IF computer science major AND high gpa THEN get good job

7 Department of Computer Science Spring 2013: April 29 CS 157B: Database Management Systems II © R. Mak 7 Publishing Composite Views  Use Composite Studio to tell the Composite Information Server (CIS) to create virtual views. The views consist of data from disparate data sources. In Studio, ask CIS to execute the view and show its contents.  CIS must publish the virtual views in order for client applications to access them. CIS publishes views as database services or as web services. Published as database services, the virtual views appear to come from a physical database. CIS can also publish the virtual views as WSDL-based or RESTful web services.  CIS fetches data from the original data sources in real time to create the views whenever a client application accesses the view.

8 Department of Computer Science Spring 2013: April 29 CS 157B: Database Management Systems II © R. Mak 8 Publishing as Database Services  When CIS publishes a virtual view as a database service, a client application connects to it and accesses its data as if the view came from a physical database. You can use JDBC or Hibernate. Put Composite’s JDBC driver on your classpath: C:\Composite Software\CIS 6.2.0\apps\jdbc\lib\csjdbc.jar Use Composite’s URL format to connect. See Composite’s Client Interfaces Guide C:\Composite Software\CIS 6.2.0\docs\ClientInterfacesGuide.pdf _ Demo

9 Department of Computer Science Spring 2013: April 29 CS 157B: Database Management Systems II © R. Mak 9 Publishing as Database Services  Sample connection code: private static final String DATASOURCE = "StudentsDB"; private static final String HOST = "cs08.cs.sjsu.edu"; private static final String USERNAME = "cs157btest"; private static final String PASSWORD = "S13cs157btest"; private static final String DOMAIN = "composite"; private static final int PORT = 9401; private Connection connect() throws ClassNotFoundException, SQLException { Class.forName("cs.jdbc.driver.CompositeDriver"); String url = "jdbc:compositesw:dbapi@" + HOST + ":" + PORT + "?domain=" + DOMAIN + "&dataSource=" + DATASOURCE; Connection conn = DriverManager.getConnection(url, USERNAME, PASSWORD); CompositeConnection compConn = (CompositeConnection) conn; compConn.clearAllDataSourceCredentials(); compConn.setDataSourceCredentials(DATASOURCE, USERNAME, PASSWORD); return conn; } Demo


Download ppt "CS 157B: Database Management Systems II April 29 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak."

Similar presentations


Ads by Google