The DERBY_HOME/demo/programs/vtis directory contains
sample table functions.
This code is now built as part of the standard Derby build.
To build the API documentation, invoke the demodocs target in the
top-level build script.
An .sql script, sql/demoFileVtis.sql, is provided
to test-drive these table functions. Use Derby's ij tool to run
this script. The script needs to be customized as explained in its header.
This script exercises the following table functions:
PropertyFileVTI - a table function for presenting a property
file as a tableApacheServerLogVTI - an example of an
org.apache.derby.vti.XmlVTI which makes a table out of an Apache
web server logDerbyJiraReportVTI - an example of an
org.apache.derby.vti.XmlVTI which makes a table out of a JIRA
reportSubversionLogVTI - a table function for making a table from the
output of the svn log commandThis demo relies on the Derby embedded JDBC driver and the interactive ij tool (used for issuing SQL):
| Class name: | org.apache.derby.jdbc.EmbeddedDriver |
| Library: | derby.jar |
| Class name: | org.apache.derby.tools.ij |
| Library: | derbytools.jar |
UNIX (ksh/bash)
export DERBY_HOME=/home/user/derby/db-derby-10.x.y.z-bin
Windows:
set DERBY_HOME=c:\programs\derby\db-derby-10.x.y.z-bin
This may be done as follows:
UNIX (ksh/bash):
export CLASSPATH=.:${DERBY_HOME}/lib/derby.jar:${DERBY_HOME}/lib/derbytools.jar
WINDOWS:
set CLASSPATH=.;%DERBY_HOME%\lib\derby.jar;%DERBY_HOME%\lib\derbytools.jar
java org.apache.derby.tools.ij demoFileVtis.sql
A successful run produces many pages of SQL commands and query results.
If any error messages appear, and you are unable to resolve the error(s), ask for help on the derby-user mailing list.