Class CustomLinkResolver

  extended by com.healthmarketscience.jackcess.util.CustomLinkResolver
All Implemented Interfaces:

public abstract class CustomLinkResolver
extends Object
implements LinkResolver

Utility base implementaton of LinkResolver which facilitates loading linked tables from files which are not access databases. The LinkResolver API ultimately presents linked table information to the primary database using the jackcess Database and Table classes. In order to consume linked tables in non-mdb files, they need to somehow be coerced into the appropriate form. The approach taken by this utility is to make it easy to copy the external tables into a temporary mdb file for consumption by the primary database.

The primary features of this utility:

James Ahlborn
Intermediate: This class requires moderate API knowledge.

Field Summary
static Database.FileFormat DEFAULT_FORMAT
          the default file format used for temp dbs
static boolean DEFAULT_IN_MEMORY
          temp dbs default to the filesystem, not in memory
          temp dbs end up in the system temp dir by default
Fields inherited from interface com.healthmarketscience.jackcess.util.LinkResolver
Method Summary
 Database resolveLinkedDatabase(Database linkerDb, String linkeeFileName)
          Custom implementation is:
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final Database.FileFormat DEFAULT_FORMAT
the default file format used for temp dbs


public static final boolean DEFAULT_IN_MEMORY
temp dbs default to the filesystem, not in memory

See Also:
Constant Field Values


public static final File DEFAULT_TEMP_DIR
temp dbs end up in the system temp dir by default

Method Detail


public Database resolveLinkedDatabase(Database linkerDb,
                                      String linkeeFileName)
                               throws IOException
Custom implementation is:
   // attempt to load the linkeeFileName as a custom file
   Object customFile = loadCustomFile(linkerDb, linkeeFileName);
   if(customFile != null) {
     // this is a custom file, create and return relevant temp db
     return createTempDb(customFile, getDefaultFormat(), isDefaultInMemory(),
   // not a custmom file, load using the default behavior
   return LinkResolver.DEFAULT.resolveLinkedDatabase(linkerDb, linkeeFileName);

Specified by:
resolveLinkedDatabase in interface LinkResolver
See Also:
loadCustomFile(com.healthmarketscience.jackcess.Database, java.lang.String), createTempDb(java.lang.Object, com.healthmarketscience.jackcess.Database.FileFormat, boolean,, LinkResolver.DEFAULT

Copyright © 2005–2017 Health Market Science. All rights reserved.