Presentation is loading. Please wait.

Presentation is loading. Please wait.

Senior Staff Engineer, Sun Microsystems

Similar presentations


Presentation on theme: "Senior Staff Engineer, Sun Microsystems"— Presentation transcript:

1 Senior Staff Engineer, Sun Microsystems
Saur Saucer Separation Rick Hillegas Senior Staff Engineer, Sun Microsystems

2 Derby-style table functions to be introduced in Derby 10.4
Use SQL on non-relational data Tear-off subsets of other databases

3 Overview of Table Functions
Log Files XML Reports External DBMSes Snapshots

4 O Overview of Table Functions Implementing a Table Function Demo Code
Creating a Table Function Invoking a Table Function Optimizing a Table Function O

5 Implementing a Table Function
Implement java.sql.ResultSet – extend a demo class if appropriate Stub out all methods except: next() close() getXXX() -- for the datatypes of your columns Create a public static method which returns your implementation of java.sql.ResultSet

6 Demo code in java/demo/vtis...
Table Function for rows of String columns Table Function wrapping a text file Table Function wrapping a properties file Table Function wrapping an xml file Table Function wrapping external query Subscription to foreign SQL data

7 Creating a Table Function

8 Invoking a Table Function

9 Optimizing a Table Function
Advanced topic Class containing Table Function must have a 0-arg constructor It must implement org.apache.derby.vti.VTICosting

10 Log Files Plain text log files XML log files

11 Plain text log files Have regular structure Sequence of records (rows) Each record has fields (columns) SQL is a great tool for mining these records

12 XML Log Files Again, regular structure Repeating elements (rows) With attributes/sub-elements (columns) SQL is a great tool for mining these files

13 Reports Exported in XML Easy to mine using SQL and Table Functions

14 External DBMSes Foreign DBMS Data Migrating Foreign Data into Derby

15 Foreign DBMS data Use Table Functions to import data from foreign databases Demo classes make it easy to create a Table Function which runs a query against a foreign database

16 Migrate foreign data into Derby
Use Demo classes to create Table Function which runs a foreign query Use 'create table ... as select' to create Derby table from Table Function shape Use 'insert into ... select * from' to pipe data from foreign database into Derby

17 Snapshots Use Demo classes to declare a parameterized subscription to foreign data Use Demo procedures to plug in new parameters and tear-off a fresh copy of the subscription


Download ppt "Senior Staff Engineer, Sun Microsystems"

Similar presentations


Ads by Google