Class MDBServiceImpl

java.lang.Object
loci.common.services.AbstractService
loci.formats.services.MDBServiceImpl
All Implemented Interfaces:
loci.common.services.Service, MDBService

public class MDBServiceImpl extends loci.common.services.AbstractService implements MDBService
Implementation of MDBService for parsing MDB database files.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Vector<mdbtools.libmdb.Holder>
     
    private mdbtools.libmdb.MdbHandle
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the currently initialized file.
    private boolean
    fetchRow(mdbtools.libmdb.MdbTableDef table)
    Fetches the next row from the table, ignoring potential parsing exceptions.
    void
    initialize(String filename)
    Prepare the given .mdb file for reading.
    Read all tables from a pre-initialized .mdb files.
    Read named table from a pre-initialized .mdb files.

    Methods inherited from class loci.common.services.AbstractService

    checkClassDependency

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mdb

      private mdbtools.libmdb.MdbHandle mdb
    • boundValues

      private Vector<mdbtools.libmdb.Holder> boundValues
  • Constructor Details

    • MDBServiceImpl

      public MDBServiceImpl()
      Default constructor.
  • Method Details

    • initialize

      public void initialize(String filename) throws IOException
      Description copied from interface: MDBService
      Prepare the given .mdb file for reading. This method must be called before MDBService.parseDatabase().
      Specified by:
      initialize in interface MDBService
      Throws:
      IOException - if a problem occurs when opening the file
    • parseDatabase

      public Vector<Vector<String[]>> parseDatabase() throws IOException
      Description copied from interface: MDBService
      Read all tables from a pre-initialized .mdb files. Each Vector<String[]> in the outer Vector represents a table; each String[] in a table represents a row, and each element of the String[] represents the value of a particular column within the row. The first row in each table contains the names for each column. The first entry in the column name row is the name of the table. MDBService.initialize(String) must be called before calling parseDatabase().
      Specified by:
      parseDatabase in interface MDBService
      Throws:
      IOException - if there is a problem reading the table data
    • parseTable

      public Vector<String[]> parseTable(String name) throws IOException
      Description copied from interface: MDBService
      Read named table from a pre-initialized .mdb files. Each String[] in a table represents a row, and each element of the String[] represents the value of a particular column within the row. The first row in the table contains the names for each column. MDBService.initialize(String) must be called before calling parseTable.
      Specified by:
      parseTable in interface MDBService
      Parameters:
      name - table name
      Returns:
      table data or null if the named table does not exist
      Throws:
      IOException - if there is a problem reading the table data
    • close

      public void close()
      Description copied from interface: MDBService
      Close the currently initialized file.
      Specified by:
      close in interface MDBService
    • fetchRow

      private boolean fetchRow(mdbtools.libmdb.MdbTableDef table)
      Fetches the next row from the table, ignoring potential parsing exceptions.
      Parameters:
      table - Table to fetch the next available row from.
      Returns:
      true if there are further rows to fetch. false if there are no further rows to fetch or an exception is thrown while parsing the row.