On 10/3/07, Law, Bill <blaw@...> wrote:
> Hi Rob,
>
> For a JDBC call asking for tables of type TABLE I agree that the
> appropriate response would be a list of TABLE objects that did not
> include FOREIGN TABLE's. However, that is not the case. All of our
> tables, both TABLE and FOREIGN TABLE, come back as being type TABLE and
> then an additional proprietary JDBC call must be made for each table to
> determine whether it is a TABLE or a FOREIGN TABLE. This is an
> architectural constraint that I am forced to live with. The reasoning
> for this behavior is to have maximum compatibility with existing JDBC
> tools that have never heard of FOREIGN TABLE.
You mean tools like SQuirreL? SQuirreL uses JDBC, which has never
introduced the concept of FOREIGN TABLEs. Unfortunately, I believe
this "compatibility" scheme is difficult for us to handle without
treating it as special case :)
> We certainly do wish to avoid requiring special-case handling code in
> SQuirreL's core feature set. In fact that's the reason for this
> question. I was hoping you could point us to where and how to implement
> this in plugin code. It seems either we could intercept the populating
> of the TABLE node and redirect certain tables to the FOREIGN TABLE node
> based on our proprietary JDBC call, or we could make use of methods of
> the classes ObjectTreeAPI and ObjectTreeNode to move the appropriate
> tables from the TABLE node to the FOREIGN TABLE node after the fact. A
> concern with doing it after the fact is being sure the moves survive a
> tree refresh. Is this possible?
It would, in my opinion, spread the concern of FOREIGN TABLES
throughout much of the framework code and bleed into other plugins as
well. Perhaps an alternative is to write a proxy driver that SQuirreL
could use (in chorus with the actual driver) to intercept calls to
DatabaseMetaData, that would strip out the FOREIGN TABLEs from the
result of DatabaseMetaData.getTables? This would allow the plugin
then to create them fresh in the location that you desire.
Rob
|