DatabaseBuilder#open(File)) or creating a new database file
(DatabaseBuilder#create(Database.FileFormat, File) ) (for more advanced opening/creating use
DatabaseBuilder). Once a Database has been opened, you can interact with the data via the relevant
Table. When a Database instance is no longer useful, it should always be closed (close) to
avoid corruption.
Database instances (and all the related objects) are not thread-safe. However, separate Database instances (and their respective objects) can be used by separate threads without a problem.
Database instances do not implement any "transactional" support, and therefore concurrent editing of the same database file by multiple Database instances (or with outside programs such as MS Access) will generally result in database file corruption.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Database.
Enum which indicates which version of Access created the database. |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | ALLOW_AUTONUM_INSERT_PROPERTY
system property which can be used to set the default allow auto number insert policy. |
| public static final String | BROKEN_NIO_PROPERTY
(boolean) system property which can be used to indicate that the current vm has a poor nio implementation
(specifically for |
| public static final String | CHARSET_PROPERTY_PREFIX
system property prefix which can be used to set the default Charset used for text data (full property includes the JetFormat version). |
| public static final String | COLUMN_ORDER_PROPERTY
system property which can be used to set the default sort order for table columns. |
| public static final String | DATE_TIME_TYPE_PROPERTY
system property which can be used to set the default date/Time type. |
| public static final boolean | DEFAULT_AUTO_SYNC
default value for the auto-sync value ( |
| public static final Table. | DEFAULT_COLUMN_ORDER
the default sort order for table columns. |
| public static final String | ENABLE_EXPRESSION_EVALUATION_PROPERTY
system property which can be used to disable expression evaluation if necessary. |
| public static final String | |
| public static final String | |
| public static final String | FK_ENFORCE_PROPERTY
system property which can be used to set the default enforcement of foreign-key relationships. |
| public static final String | RESOURCE_PATH_PROPERTY
system property which can be used to set the path from which classpath resources are loaded (must end with a "/" if non-empty). |
| public static final String | TIMEZONE_PROPERTY
system property which can be used to set the default TimeZone used for date calculations. |
| public static final String | WRITE_BROKEN_INDEX_PROPERTY
System property which can be used to allow writing indexes with unsupported text sort orders. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | createLinkedTable(String
Name of the table to create in this database name, String path to the linked database linkedDbName, String name of the table in the linked database linkedTableName)Create a new table in this database |
| public void | flush()
Redeclares java. Flushes any current changes to the database file (and any linked databases) to disk. |
| public Charset | |
| public Table. | |
| public ColumnValidatorFactory | |
| public String | Returns: the current database password, ornull if none set.Returns the current database password, or |
| public PropertyMap | Returns: the core properties for the databaseReturns the core properties for the database. |
| public DateTimeType | |
| public ErrorHandler | |
| public EvalConfig | |
| public File | |
| public Database. | getFileFormat()
Returns the FileFormat of this database (which may involve inspecting the database itself). |
| public Map | getLinkedDatabases()
Returns an unmodifiable view of the currently loaded linked databases, mapped from the linked database file name to the linked database. |
| public LinkResolver | |
| public Path | |
| public List | |
| public List | getRelationships(Table table1, Table table2)
Finds all the relationships in the database between the given tables. |
| public List | |
| public List | |
| public PropertyMap | Returns: the summary properties for the databaseReturns the summary properties for the database. |
| public List | |
| public Table | Returns: The table, ornull if it doesn't existTable name, may be a system table tableName)Returns a reference to any available table in this access database, including system tables. |
| public Set | Returns: The names of all of the system tables (String). Note, in order to read these tables, you must usegetSystemTable. Extreme care should be taken if modifying these tables directly!.Returns the names of all of the system tables (String). |
| public Table | |
| public TableMetaData | Returns: The meta data for the table, or null if it doesn't existTable name (case-insensitive), may be any table type (i.e. includes system or linked tables). name)Returns the meta data for the table, or null if it doesn't exist. |
| public Set | Returns: The names of all of the user tablesReturns the names of all of the user tables. |
| public TimeZone | |
| public PropertyMap | Returns: the user-defined properties for the databaseReturns the user-defined properties for the database. |
| public ZoneId | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public Iterator | Returns: an unmodifiable Iterator of the user Tables in this Database.Redeclares java. Returns an iterator over elements of type |
| public TableIterableBuilder | |
| public Iterable | Returns: an Iterable which returns an unmodifiable Iterator of the the TableMetaData for all tables in this Database.Returns an Iterable which returns an unmodifiable Iterator of the the TableMetaData for all tables in this Database. |
| public default Stream | Returns: a Stream using thenewTableMetaDataIterableReturns a Stream using the |
| public void | setAllowAutoNumberInsert(Boolean allowAutoNumInsert)
Sets the new auto number insert policy for the database (unless overridden at the Table level). |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public default Stream |
| ALLOW_AUTONUM_INSERT_PROPERTY | back to summary |
|---|---|
| public static final String ALLOW_AUTONUM_INSERT_PROPERTY system property which can be used to set the default allow auto number insert policy. Defaults to | |
| BROKEN_NIO_PROPERTY | back to summary |
|---|---|
| public static final String BROKEN_NIO_PROPERTY (boolean) system property which can be used to indicate that the current vm has a poor nio implementation
(specifically for | |
| CHARSET_PROPERTY_PREFIX | back to summary |
|---|---|
| public static final String CHARSET_PROPERTY_PREFIX system property prefix which can be used to set the default Charset used for text data (full property includes the JetFormat version). | |
| COLUMN_ORDER_PROPERTY | back to summary |
|---|---|
| public static final String COLUMN_ORDER_PROPERTY system property which can be used to set the default sort order for table columns. Value should be one of
| |
| DATE_TIME_TYPE_PROPERTY | back to summary |
|---|---|
| public static final String DATE_TIME_TYPE_PROPERTY system property which can be used to set the default date/Time type. Value should be one of | |
| DEFAULT_AUTO_SYNC | back to summary |
|---|---|
| public static final boolean DEFAULT_AUTO_SYNC default value for the auto-sync value ( | |
| DEFAULT_COLUMN_ORDER | back to summary |
|---|---|
| public static final Table. the default sort order for table columns. | |
| ENABLE_EXPRESSION_EVALUATION_PROPERTY | back to summary |
|---|---|
| public static final String ENABLE_EXPRESSION_EVALUATION_PROPERTY system property which can be used to disable expression evaluation if necessary. Defaults to | |
| FILE_EXT_ACCDB | back to summary |
|---|---|
| public static final String FILE_EXT_ACCDB | |
| FILE_EXT_MDB | back to summary |
|---|---|
| public static final String FILE_EXT_MDB | |
| FK_ENFORCE_PROPERTY | back to summary |
|---|---|
| public static final String FK_ENFORCE_PROPERTY system property which can be used to set the default enforcement of foreign-key relationships. Defaults to
| |
| RESOURCE_PATH_PROPERTY | back to summary |
|---|---|
| public static final String RESOURCE_PATH_PROPERTY system property which can be used to set the path from which classpath resources are loaded (must end with a "/" if non-empty). Default value is io/github/spannm/jackcess/ if unspecified. | |
| TIMEZONE_PROPERTY | back to summary |
|---|---|
| public static final String TIMEZONE_PROPERTY system property which can be used to set the default TimeZone used for date calculations. | |
| WRITE_BROKEN_INDEX_PROPERTY | back to summary |
|---|---|
| public static final String WRITE_BROKEN_INDEX_PROPERTY System property which can be used to allow writing indexes with unsupported text sort orders. Defaults to
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Redeclares java. Close the database file (and any linked databases). A Database must be closed after use or changes could be lost and the Database file corrupted. A Database instance should be treated like any other external resource which would be closed in a finally block (e.g. an OutputStream or jdbc Connection).
| |
| createLinkedTable | back to summary |
|---|---|
| public void createLinkedTable(String name, String linkedDbName, String linkedTableName) throws IOException Create a new table in this database | |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Redeclares java. Flushes any current changes to the database file (and any linked databases) to disk.
| |
| getCharset | back to summary |
|---|---|
| public Charset getCharset() Gets currently configured Charset (always non- | |
| getColumnOrder | back to summary |
|---|---|
| public Table. Gets currently configured | |
| getColumnValidatorFactory | back to summary |
|---|---|
| public ColumnValidatorFactory getColumnValidatorFactory() Gets currently configured ColumnValidatorFactory (always non- | |
| getDatabasePassword | back to summary |
|---|---|
| public String getDatabasePassword() throws IOException Returns the current database password, or
| |
| getDatabaseProperties | back to summary |
|---|---|
| public PropertyMap getDatabaseProperties() throws IOException Returns the core properties for the database.
| |
| getDateTimeType | back to summary |
|---|---|
| public DateTimeType getDateTimeType() Gets the currently configured DateTimeType. | |
| getErrorHandler | back to summary |
|---|---|
| public ErrorHandler getErrorHandler() Gets the currently configured ErrorHandler (always non- | |
| getEvalConfig | back to summary |
|---|---|
| public EvalConfig getEvalConfig() Returns the EvalConfig for configuring expression evaluation. | |
| getFile | back to summary |
|---|---|
| public File getFile() Returns the File underlying this Database | |
| getFileFormat | back to summary |
|---|---|
| public Database. Returns the FileFormat of this database (which may involve inspecting the database itself).
| |
| getLinkedDatabases | back to summary |
|---|---|
| public Map Returns an unmodifiable view of the currently loaded linked databases, mapped from the linked database file name to the linked database. This information may be useful for implementing a LinkResolver. | |
| getLinkResolver | back to summary |
|---|---|
| public LinkResolver getLinkResolver() Gets the currently configured LinkResolver (always non- | |
| getPath | back to summary |
|---|---|
| public Path getPath() Returns the File underlying this Database | |
| getQueries | back to summary |
|---|---|
| public List Finds all the queries in the database. | |
| getRelationships | back to summary |
|---|---|
| public List Finds all the relationships in the database between the given tables. | |
| getRelationships | back to summary |
|---|---|
| public List Finds all the relationships in the database for the given table. | |
| getRelationships | back to summary |
|---|---|
| public List Finds all the relationships in the database in non-system tables. Warning, this may load all the Tables (metadata, not data) in the database which could cause memory issues. | |
| getSummaryProperties | back to summary |
|---|---|
| public PropertyMap getSummaryProperties() throws IOException Returns the summary properties for the database.
| |
| getSystemRelationships | back to summary |
|---|---|
| public List Finds all the relationships in the database, including system tables. Warning, this may load all the Tables (metadata, not data) in the database which could cause memory issues. | |
| getSystemTable | back to summary |
|---|---|
| public Table getSystemTable(String tableName) throws IOException Returns a reference to any available table in this access database, including system tables. Warning, this method is not designed for common use, only for the occassional time when access to a system table is necessary. Messing with system tables can strip the paint off your house and give your whole family a permanent, orange afro. You have been warned. | |
| getSystemTableNames | back to summary |
|---|---|
| public Set Returns the names of all of the system tables (String). Note, in order to read these tables, you must use
| |
| getTable | back to summary |
|---|---|
| public Table getTable(String name) throws IOException Returns the Table, or null if it doesn't exist (or is a system table). | |
| getTableMetaData | back to summary |
|---|---|
| public TableMetaData getTableMetaData(String name) throws IOException Returns the meta data for the table, or null if it doesn't exist.
| |
| getTableNames | back to summary |
|---|---|
| public Set Returns the names of all of the user tables. | |
| getTimeZone | back to summary |
|---|---|
| public TimeZone getTimeZone() Gets currently configured TimeZone (always non- | |
| getUserDefinedProperties | back to summary |
|---|---|
| public PropertyMap getUserDefinedProperties() throws IOException Returns the user-defined properties for the database.
| |
| getZoneId | back to summary |
|---|---|
| public ZoneId getZoneId() Gets currently configured ZoneId (always non- | |
| isAllowAutoNumberInsert | back to summary |
|---|---|
| public boolean isAllowAutoNumberInsert() Gets current allow auto number insert policy. By default, jackcess does not allow auto numbers to be inserted or
updated directly (they are always handled internally by the Table). Setting this policy to | |
| isEnforceForeignKeys | back to summary |
|---|---|
| public boolean isEnforceForeignKeys() Gets current foreign-key enforcement policy. | |
| isEvaluateExpressions | back to summary |
|---|---|
| public boolean isEvaluateExpressions() Gets the current expression evaluation policy. Expression evaluation is enabled by default but can be disabled if necessary. | |
| isLinkedTable | back to summary |
|---|---|
| public boolean isLinkedTable(Table table) throws IOException Returns | |
| isWriteBrokenIndex | back to summary |
|---|---|
| public boolean isWriteBrokenIndex() Gets the current write broken index policy. See | |
| iterator | back to summary |
|---|---|
| public Iterator Redeclares java. Doc from java. Returns an iterator over elements of type
| |
| newIterable | back to summary |
|---|---|
| public TableIterableBuilder newIterable() Convenience method for constructing a new TableIterableBuilder for this cursor. A TableIterableBuilder provides a variety of options for more flexible iteration of Tables. | |
| newTableMetaDataIterable | back to summary |
|---|---|
| public Iterable Returns an Iterable which returns an unmodifiable Iterator of the the TableMetaData for all tables in this Database.
| |
| newTableMetaDataStream | back to summary |
|---|---|
| public default Stream Returns a Stream using the
| |
| setAllowAutoNumberInsert | back to summary |
|---|---|
| public void setAllowAutoNumberInsert(Boolean allowAutoNumInsert) Sets the new auto number insert policy for the database (unless overridden at the Table level). If | |
| setCharset | back to summary |
|---|---|
| public void setCharset(Charset newCharset) Sets a new Charset. If | |
| setColumnOrder | back to summary |
|---|---|
| public void setColumnOrder(Table. Sets a new Table.ColumnOrder. If | |
| setColumnValidatorFactory | back to summary |
|---|---|
| public void setColumnValidatorFactory(ColumnValidatorFactory newFactory) Sets a new ColumnValidatorFactory. If | |
| setDateTimeType | back to summary |
|---|---|
| public void setDateTimeType(DateTimeType dateTimeType) Sets the DateTimeType. If | |
| setEnforceForeignKeys | back to summary |
|---|---|
| public void setEnforceForeignKeys(Boolean newEnforceForeignKeys) Sets a new foreign-key enforcement policy. If | |
| setErrorHandler | back to summary |
|---|---|
| public void setErrorHandler(ErrorHandler newErrorHandler) Sets a new ErrorHandler. If | |
| setEvaluateExpressions | back to summary |
|---|---|
| public void setEvaluateExpressions(Boolean evaluateExpressions) Sets the current expression evaluation policy. Expression evaluation is enabled by default but can be disabled if
necessary. If | |
| setLinkResolver | back to summary |
|---|---|
| public void setLinkResolver(LinkResolver newLinkResolver) Sets a new LinkResolver. If | |
| setTimeZone | back to summary |
|---|---|
| public void setTimeZone(TimeZone newTimeZone) Sets a new TimeZone. If | |
| setWriteBrokenIndex | back to summary |
|---|---|
| public void setWriteBrokenIndex(Boolean writeBrokenIndex) Sets the current write broken index policy. If | |
| setZoneId | back to summary |
|---|---|
| public void setZoneId(ZoneId newZoneId) Sets a new ZoneId. If | |
| stream | back to summary |
|---|---|
| public default Stream Returns a Stream using the default Iterator. | |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| public static final Database. | GENERIC_JET4
A database which was most likely created programmatically (e.g. using windows ADOX) |
| public static final Database. | MSISAM
A database which was created by MS Money |
| public static final Database. | V1997
A database which was created by MS Access 97 |
| public static final Database. | V2000
A database which was created by MS Access 2000 |
| public static final Database. | V2003
A database which was created by MS Access 2002/2003 |
| public static final Database. | V2007
A database which was created by MS Access 2007 |
| public static final Database. | V2010
A database which was created by MS Access 2010+ |
| public static final Database. | V2016
A database which was created by MS Access 2016+ |
| public static final Database. | V2019
A database which was created by MS Access 2019+ (Office 365) |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the file extension used for database files with this format.Returns the file extension used for database files with this format. |
| public static Database. | |
| public String | toString()
Overrides java. Returns the name of this enum constant, as contained in the declaration. |
| public static Database. | |
| public static Database. |
| ext | back to summary |
|---|---|
| private final String ext | |
| GENERIC_JET4 | back to summary |
|---|---|
| public static final Database. A database which was most likely created programmatically (e.g. using windows ADOX) | |
| MSISAM | back to summary |
|---|---|
| public static final Database. A database which was created by MS Money | |
| V1997 | back to summary |
|---|---|
| public static final Database. A database which was created by MS Access 97 | |
| V2000 | back to summary |
|---|---|
| public static final Database. A database which was created by MS Access 2000 | |
| V2003 | back to summary |
|---|---|
| public static final Database. A database which was created by MS Access 2002/2003 | |
| V2007 | back to summary |
|---|---|
| public static final Database. A database which was created by MS Access 2007 | |
| V2010 | back to summary |
|---|---|
| public static final Database. A database which was created by MS Access 2010+ | |
| V2016 | back to summary |
|---|---|
| public static final Database. A database which was created by MS Access 2016+ | |
| V2019 | back to summary |
|---|---|
| public static final Database. A database which was created by MS Access 2019+ (Office 365) | |
| FileFormat | back to summary |
|---|---|
| private FileFormat(String _ext) | |
| getFileExtension | back to summary |
|---|---|
| public String getFileExtension() Returns the file extension used for database files with this format.
| |
| parse | back to summary |
|---|---|
public static Database.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists.
| |
| valueOf | back to summary |
|---|---|
| public static Database. | |
| values | back to summary |
|---|---|
| public static Database. | |