Product Examples

HomeBank Derby Example

See the Examples Home for more examples. This example can be downloaded from our Download Page.

Overview

This example consists of two pre-defined Derby databases that can be federated and queried using MetaMatrix Query as one data source. The sample data set is the HomeBank banking data set, consisting of the following databases:

  • HomeBank - The 'main' office, with tables of all employees and all branches
  • HomeBank01 - The 1st (and only!) branch of the bank, with tables of customers, accounts, transactions, etc

Derby is a full-featured database and is an Apache DB subproject implemented in Java. For more information on Derby see Apache Derby.

Set Up

Perform the following steps to use this data set:

  1. Download and install MetaMatrix Query
  2. Download this example
  3. Unzip the example file into the root of your MetaMatrix Query installation
    • The example will be placed under the examples/derby directory
    • Included in the example directory are scripts that start and stop Derby Network Server
  4. Start Derby in Network Server mode using the startDerby script in the example directory
    • This should be done in its own command window, as the server will be 'active' after being started and so you will not be able to type in the window any more
    • The JAVA_HOME environment variable must be set to run these scripts. See the comments in the scripts themselves for the method to set JAVA_HOME.
  5. When finished, stop Derby from a separate command window using the stopDerby script in the example directory
WARNING
It's very important that the Derby Network Server be shut down properly.

The following files are included:

  • README - Brief text description of how to use the example
  • HomeBank Example Data Set - Describes the HomeBank example data set
  • startDerby - Used to start the Derby database in Network Server mode
  • stopDerby - Used to stopt the Derby database
  • homeBankScript.txt - MMShell script
  • db/ - Directory containing the 2 databases
  • lib/ - Directory containing the Derby DBMS software

Script

There is a script (homeBankScript.txt) in the example directory that can be executed via MMShell. This script illustrates how to:

  • Create a VDB
  • Add two data sources to the VDB
  • Browse the data sources
  • Import metadata from the two data sources
  • Query the VDB accessing *both* data sources
  • Package the VDB for deployment

The best way to learn is to use homeBankScript.txt as guide and perform its instructions interactively. You can see a sample interactive session using the commands from this script on this page.

See Query quick start for more information.