Hi David,
Some comments inline...
...
re your comment of String constants in an array. I found the same
thing in the interface.
It has just occured to me that, as we use a database, maybe a
resultSet may be the thing to return , I've come full circle to
understanding your original idea of a 'Table Function'. But I would
still think that a function in DatabaseMetaData would be good.
Along these lines... it should take a String argument that is the word
being tested, and return true [word is in list] or false [word is not
in the list]. I propose to call the method prototype to be something
like getAllDerbyKeyWords(String wordToTest) . Hopefully as it has the
word 'Derby' in it the SQL people are unlikely to ever use is in the
standard! Although maybe there would be an argument to propose a new
method of getAllKeywords() to the standard, that each driver vendor
could implement and would have the same / similar functionality -
delusions of grandeur ;)
The presence of Derby in the function name sounds good to me. I agree
that that should prevent the JDBC spec from encroaching on this
function. I'm afraid I don't understand the usefulness of the String
argument. Having a no-arg function which returns all of the words sounds
good enough to me. The restriction to a single string can be
accomplished by this query against the resulting table function:
select keyword from table( getAllDerbyKeyWords() ) t where t.keyword =
'wordToTest'
But how to turn that String Array into a Table is fairly simple (I'd
declare a temp table), and then make a select on it to get a
resultSet. However is there a way to skip the table step and jump
straight to a result set (its a bit of a leading question, and I
haven't searched for an answer anywhere yet, so unless you know off
the top of your head no need to answer straight away).
The table function can just be an extension of
org.apache.derby.vti.StringColumnVTI. All you have to implement are 3
methods: next(), close(), and getRawColumn().
Hope this helps,
-Rick
David