db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Griffin <...@roadrunner.com>
Subject Table Function Question
Date Fri, 28 Dec 2007 22:28:42 GMT
I've been looking into Table Functions as a way to access external data,
and I'm running into some design questions.

Briefly, I need to provide Java code which provides access to arbitrary
tables in a foreign database.

The problem I'm seeing from the docs is that it looks like Table
Functions have to be specific to the ResultSet being produced, i.e. you
have to write a specific Table Function class for each ResultSet.  This
makes it difficult to write a single class which can handle multiple
virtual tables.

My intention was to provide configuration file(s) keyed on user-supplied
names so that a single Table Function class, given the name, could
initiate the foreign query associated with that name.  The same files
would be used by my code which wraps Derby to inject CREATE FUNCTION
statements into Derby before allowing user access, so that the users who
coded the configuration files can refer to foreign tables by the same
names used in the configuration files.

Is there a way to do this that I'm not seeing ?

If not, would it be possible to add an optional keyword to CREATE
FUNCTION which could be passed to the Table Function to allow it to
customize its processing ?  For compatibility, this could require that
the Table Function implement a new interface which provides a method to
be called to set the keyword value (much as is done for the Optimizer

View raw message