Menu

#28 simpler way to identify linked tables

2.0.9
closed
nobody
None
1
2015-03-04
2015-02-11
No

Maybe you could have a flag in the Table object to indicate that it was fetched from a different database to the one it belongs to, even if it is meaningless out of that context. Or alternatively provide a Database.getLinkedTables() or Database.getLinkedTableNames() method. I doubt many users would think of the technique you've provided.

from: https://sourceforge.net/p/jackcess/discussion/456474/thread/6b08bfed/

Discussion

  • James Ahlborn

    James Ahlborn - 2015-02-11

    Actually I have another suggestion as well. If a linked table's destination database doesn't exist the iterator throws a FileNotFoundException. That means the only way to iterate the local tables is to call getTableNames(), get each Table object by name, if a FileNotFoundException is thrown ignore that table, otherwise check if it is linked and ignore if so. To avoid the exceptions completely I'd have to go through the MSysObjects table and check types, flags etc.

    It would be nice if the Database class offered a getLocalTableNames() and/or getLinkedTableNames() method to make this simpler.

     
  • James Ahlborn

    James Ahlborn - 2015-03-04
    • status: open --> closed
    • Group: Unnassigned --> 2.0.9
     
  • James Ahlborn

    James Ahlborn - 2015-03-04

    Added Database.isLinkedTable to determine if a Table is linked to a Database.

    Added Database.newIterable which returns a TableIterableBuilder for more flexible Table iteration.

    Fixed in trunk, will be 2.0.9 release.

     

Log in to post a comment.

Auth0 Logo