Class DatabaseImpl
- java.lang.Object
-
- com.healthmarketscience.jackcess.impl.DatabaseImpl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDatabaseImpl.FileFormatDetailsInternal details for each FileForrmat-
Nested classes/interfaces inherited from interface com.healthmarketscience.jackcess.Database
Database.FileFormat
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_RESOURCE_PATHthe default value for the resource path used to load classpath resources.static intHIDDEN_OBJECT_FLAGthis object is hidden-
Fields inherited from interface com.healthmarketscience.jackcess.Database
ALLOW_AUTONUM_INSERT_PROPERTY, ALLOW_LINK_RESOLUTION_PROPERTY, BROKEN_NIO_PROPERTY, CHARSET_PROPERTY_PREFIX, COLUMN_ORDER_PROPERTY, DATE_TIME_TYPE_PROPERTY, DEFAULT_AUTO_SYNC, DEFAULT_COLUMN_ORDER, ENABLE_EXPRESSION_EVALUATION_PROPERTY, FK_ENFORCE_PROPERTY, RESOURCE_PATH_PROPERTY, TIMEZONE_PROPERTY, WRITE_BROKEN_INDEX_PROPERTY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Close the database file (and any linked databases).static DatabaseImplcreate(Database.FileFormat fileFormat, Path mdbFile, FileChannel channel, boolean autoSync, Charset charset, TimeZone timeZone)Create a new Database for the given fileFormatSimpleDateFormatcreateDateFormat(String formatStr)Returns a SimpleDateFormat for the given format string which is configured with a compatible Calendar instance (seeDatabaseBuilder.toCompatibleCalendar(java.util.Calendar)) and this database'sTimeZone.voidcreateLinkedTable(String name, String linkedDbName, String linkedTableName)Create a new table in this databasevoidcreateTable(String name, List<ColumnBuilder> columns)Deprecated.useTableBuilderinsteadvoidcreateTable(String name, List<ColumnBuilder> columns, List<IndexBuilder> indexes)Deprecated.useTableBuilderinsteadvoidflush()Flushes any current changes to the database file (and any linked databases) to disk.TableImplgetAccessControlEntries()CharsetgetCharset()Gets currently configured Charset (always non-null).Table.ColumnOrdergetColumnOrder()Gets currently configuredTable.ColumnOrder(always non-null).ColumnValidatorFactorygetColumnValidatorFactory()Gets currently configured ColumnValidatorFactory (always non-null).StringgetDatabasePassword()PropertyMapgetDatabaseProperties()com.healthmarketscience.jackcess.impl.ColumnImpl.DateTimeFactorygetDateTimeFactory()DateTimeTypegetDateTimeType()Gets the currently configured DateTimeType.static booleangetDefaultAllowAutoNumberInsert()Returns the default allow auto number insert policy.static CharsetgetDefaultCharset(JetFormat format)Returns the default Charset for the given JetFormat.shortgetDefaultCodePage()static Table.ColumnOrdergetDefaultColumnOrder()Returns the default Table.ColumnOrder.static DateTimeTypegetDefaultDateTimeType()Returns the default DateTimeType.static booleangetDefaultEnforceForeignKeys()Returns the default enforce foreign-keys policy.static booleangetDefaultEvaluateExpressions()Returns the default enable expression evaluation policy.static LinkResolvergetDefaultLinkResolver()Returns the LinkResolver used when none has been configured on the Database.ColumnImpl.SortOrdergetDefaultSortOrder()static TimeZonegetDefaultTimeZone()Returns the default TimeZone.static booleangetDefaultWriteBrokenIndex()Returns the default allow broken index policy.ErrorHandlergetErrorHandler()Gets the currently configured ErrorHandler (always non-null).EvalConfiggetEvalConfig()Returns the EvalConfig for configuring expression evaluation.FilegetFile()Returns the File underlying this DatabaseDatabase.FileFormatgetFileFormat()Returns the FileFormat of this database (which may involve inspecting the database itself).static DatabaseImpl.FileFormatDetailsgetFileFormatDetails(Database.FileFormat fileFormat)JetFormatgetFormat()Map<String,Database>getLinkedDatabases()Returns an unmodifiable view of the currently loaded linked databases, mapped from the linked database file name to the linked database.LinkResolvergetLinkResolver()Gets the currently configured LinkResolver (always non-null).StringgetName()PageChannelgetPageChannel()static byte[]getPasswordMask(ByteBuffer buffer, JetFormat format)Returns the password mask retrieved from the given header page and format, ornullif this format does not use a password mask.PathgetPath()Returns the File underlying this DatabasePropertyMapsgetPropertiesForObject(int objectId, com.healthmarketscience.jackcess.impl.PropertyMaps.Owner owner)List<Query>getQueries()Finds all the queries in the database.List<Relationship>getRelationships()Finds all the relationships in the database in non-system tables.List<Relationship>getRelationships(TableImpl table1, TableImpl table2)List<Relationship>getRelationships(Table table)Finds all the relationships in the database for the given table.List<Relationship>getRelationships(Table table1, Table table2)Finds all the relationships in the database between the given tables.PropertyMapgetSummaryProperties()TableImplgetSystemCatalog()TableImplgetSystemComplexColumns()List<Relationship>getSystemRelationships()Finds all the relationships in the database, including system tables.TableImplgetSystemTable(String tableName)Returns a reference to any available table in this access database, including system tables.Set<String>getSystemTableNames()TableImplgetTable(int tableDefPageNumber)TableImplgetTable(String name)TableMetaDatagetTableMetaData(String name)Set<String>getTableNames()TimeZonegetTimeZone()Gets currently configured TimeZone (always non-nulland aligned with the ZoneId).PropertyMapgetUserDefinedProperties()ZoneIdgetZoneId()Gets currently configured ZoneId (always non-nulland aligned with the TimeZone).booleanisAllowAutoNumberInsert()Gets current allow auto number insert policy.booleanisEnforceForeignKeys()Gets current foreign-key enforcement policy.booleanisEvaluateExpressions()Gets the current expression evaluation policy.booleanisLinkedTable(Table table)Returnstrueif this Database links to the given Table,falseotherwise.booleanisReadOnly()booleanisWriteBrokenIndex()Gets the current write broken index policy.Iterator<Table>iterator()Iterator<Table>iterator(TableIterableBuilder builder)TableIterableBuildernewIterable()Convenience method for constructing a new TableIterableBuilder for this cursor.Iterable<TableMetaData>newTableMetaDataIterable()static DatabaseImplopen(Path mdbFile, boolean readOnly, FileChannel channel, boolean autoSync, Charset charset, TimeZone timeZone, CodecProvider provider, boolean ignoreSystemCatalogIndex)Open an existing Database.PropertyMapsreadProperties(byte[] propsBytes, int objectId, RowIdImpl rowId)voidsetAllowAutoNumberInsert(Boolean allowAutoNumInsert)Sets the new auto number insert policy for the database (unless overridden at the Table level).voidsetCharset(Charset newCharset)Sets a new Charset.voidsetColumnOrder(Table.ColumnOrder newColumnOrder)Sets a new Table.ColumnOrder.voidsetColumnValidatorFactory(ColumnValidatorFactory newFactory)Sets a new ColumnValidatorFactory.voidsetDateTimeType(DateTimeType dateTimeType)Sets the DateTimeType.voidsetEnforceForeignKeys(Boolean newEnforceForeignKeys)Sets a new foreign-key enforcement policy.voidsetErrorHandler(ErrorHandler newErrorHandler)Sets a new ErrorHandler.voidsetEvaluateExpressions(Boolean evaluateExpressions)Sets the current expression evaluation policy.voidsetLinkResolver(LinkResolver newLinkResolver)Sets a new LinkResolver.voidsetTimeZone(TimeZone newTimeZone)Sets a new TimeZone.voidsetWriteBrokenIndex(Boolean writeBrokenIndex)Sets the current write broken index policy.voidsetZoneId(ZoneId newZoneId)Sets a new ZoneId.static StringtoLookupName(String name)StringtoString()static voidvalidateIdentifierName(String name, int maxLength, String identifierType)Validates an identifier name.voidvalidateNewTableName(String name)-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.healthmarketscience.jackcess.Database
newTableMetaDataStream, stream
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
DEFAULT_RESOURCE_PATH
public static final String DEFAULT_RESOURCE_PATH
the default value for the resource path used to load classpath resources.- See Also:
- Constant Field Values
-
HIDDEN_OBJECT_FLAG
public static final int HIDDEN_OBJECT_FLAG
this object is hidden- See Also:
- Constant Field Values
-
-
Method Detail
-
open
public static DatabaseImpl open(Path mdbFile, boolean readOnly, FileChannel channel, boolean autoSync, Charset charset, TimeZone timeZone, CodecProvider provider, boolean ignoreSystemCatalogIndex) throws IOException
Open an existing Database. If the existing file is not writeable or the readOnly flag istrue, the file will be opened read-only.- Parameters:
mdbFile- File containing the databasereadOnly- ifftrue, force opening file in read-only modechannel- pre-opened FileChannel. if provided explicitly, it will not be closed by this Database instanceautoSync- whether or not to enable auto-syncing on write. iftrue, writes will be immediately flushed to disk. This leaves the database in a (fairly) consistent state on each write, but can be very inefficient for many updates. iffalse, flushing to disk happens at the jvm's leisure, which can be much faster, but may leave the database in an inconsistent state if failures are encountered during writing. Writes may be flushed at any time usingflush().charset- Charset to use, ifnull, uses defaulttimeZone- TimeZone to use, ifnull, uses defaultprovider- CodecProvider for handling page encoding/decoding, may benullif no special encoding is necessary- Throws:
IOException- Usage:
- Advanced: This method is for advanced/internal use.
-
create
public static DatabaseImpl create(Database.FileFormat fileFormat, Path mdbFile, FileChannel channel, boolean autoSync, Charset charset, TimeZone timeZone) throws IOException
Create a new Database for the given fileFormat- Parameters:
fileFormat- version of new database.mdbFile- Location to write the new database to. If this file already exists, it will be overwritten.channel- pre-opened FileChannel. if provided explicitly, it will not be closed by this Database instanceautoSync- whether or not to enable auto-syncing on write. iftrue, writes will be immediately flushed to disk. This leaves the database in a (fairly) consistent state on each write, but can be very inefficient for many updates. iffalse, flushing to disk happens at the jvm's leisure, which can be much faster, but may leave the database in an inconsistent state if failures are encountered during writing. Writes may be flushed at any time usingflush().charset- Charset to use, ifnull, uses defaulttimeZone- TimeZone to use, ifnull, uses default- Throws:
IOException- Usage:
- Advanced: This method is for advanced/internal use.
-
getFile
public File getFile()
Description copied from interface:DatabaseReturns the File underlying this Database
-
getPath
public Path getPath()
Description copied from interface:DatabaseReturns the File underlying this Database
-
getName
public String getName()
-
isReadOnly
public boolean isReadOnly()
-
getPageChannel
public PageChannel getPageChannel()
- Usage:
- Advanced: This method is for advanced/internal use.
-
getFormat
public JetFormat getFormat()
- Usage:
- Advanced: This method is for advanced/internal use.
-
getSystemCatalog
public TableImpl getSystemCatalog()
- Returns:
- The system catalog table
- Usage:
- Advanced: This method is for advanced/internal use.
-
getAccessControlEntries
public TableImpl getAccessControlEntries() throws IOException
- Returns:
- The system Access Control Entries table (loaded on demand)
- Throws:
IOException- Usage:
- Advanced: This method is for advanced/internal use.
-
getSystemComplexColumns
public TableImpl getSystemComplexColumns() throws IOException
- Returns:
- the complex column system table (loaded on demand)
- Throws:
IOException- Usage:
- Advanced: This method is for advanced/internal use.
-
getErrorHandler
public ErrorHandler getErrorHandler()
Description copied from interface:DatabaseGets the currently configured ErrorHandler (always non-null). This will be used to handle all errors unless overridden at the Table or Cursor level.- Specified by:
getErrorHandlerin interfaceDatabase
-
setErrorHandler
public void setErrorHandler(ErrorHandler newErrorHandler)
Description copied from interface:DatabaseSets a new ErrorHandler. Ifnull, resets to theErrorHandler.DEFAULT.- Specified by:
setErrorHandlerin interfaceDatabase
-
getLinkResolver
public LinkResolver getLinkResolver()
Description copied from interface:DatabaseGets the currently configured LinkResolver (always non-null). This will be used to handle all linked database loading.- Specified by:
getLinkResolverin interfaceDatabase
-
setLinkResolver
public void setLinkResolver(LinkResolver newLinkResolver)
Description copied from interface:DatabaseSets a new LinkResolver. Ifnull, resets to the default resolver, which refuses to open linked databases unless the "com.healthmarketscience.jackcess.allowLinkResolution" system property is enabled. UseLinkResolver.UNRESTRICTEDonly when the linked database file names can be trusted.- Specified by:
setLinkResolverin interfaceDatabase
-
getLinkedDatabases
public Map<String,Database> getLinkedDatabases()
Description copied from interface:DatabaseReturns 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.- Specified by:
getLinkedDatabasesin interfaceDatabase
-
isLinkedTable
public boolean isLinkedTable(Table table) throws IOException
Description copied from interface:DatabaseReturnstrueif this Database links to the given Table,falseotherwise.- Specified by:
isLinkedTablein interfaceDatabase- Throws:
IOException
-
getTimeZone
public TimeZone getTimeZone()
Description copied from interface:DatabaseGets currently configured TimeZone (always non-nulland aligned with the ZoneId).- Specified by:
getTimeZonein interfaceDatabase
-
setTimeZone
public void setTimeZone(TimeZone newTimeZone)
Description copied from interface:DatabaseSets a new TimeZone. Ifnull, resets to the default value. Note that setting the TimeZone will alter the ZoneId as well.- Specified by:
setTimeZonein interfaceDatabase
-
getZoneId
public ZoneId getZoneId()
Description copied from interface:DatabaseGets currently configured ZoneId (always non-nulland aligned with the TimeZone).
-
setZoneId
public void setZoneId(ZoneId newZoneId)
Description copied from interface:DatabaseSets a new ZoneId. Ifnull, resets to the default value. Note that setting the ZoneId will alter the TimeZone as well.
-
getDateTimeType
public DateTimeType getDateTimeType()
Description copied from interface:DatabaseGets the currently configured DateTimeType.- Specified by:
getDateTimeTypein interfaceDatabase
-
setDateTimeType
public void setDateTimeType(DateTimeType dateTimeType)
Description copied from interface:DatabaseSets the DateTimeType. Ifnull, resets to the default value.- Specified by:
setDateTimeTypein interfaceDatabase
-
getDateTimeFactory
public com.healthmarketscience.jackcess.impl.ColumnImpl.DateTimeFactory getDateTimeFactory()
-
getCharset
public Charset getCharset()
Description copied from interface:DatabaseGets currently configured Charset (always non-null).- Specified by:
getCharsetin interfaceDatabase
-
setCharset
public void setCharset(Charset newCharset)
Description copied from interface:DatabaseSets a new Charset. Ifnull, resets to the default value.- Specified by:
setCharsetin interfaceDatabase
-
getColumnOrder
public Table.ColumnOrder getColumnOrder()
Description copied from interface:DatabaseGets currently configuredTable.ColumnOrder(always non-null).- Specified by:
getColumnOrderin interfaceDatabase
-
setColumnOrder
public void setColumnOrder(Table.ColumnOrder newColumnOrder)
Description copied from interface:DatabaseSets a new Table.ColumnOrder. Ifnull, resets to the default value.- Specified by:
setColumnOrderin interfaceDatabase
-
isEnforceForeignKeys
public boolean isEnforceForeignKeys()
Description copied from interface:DatabaseGets current foreign-key enforcement policy.- Specified by:
isEnforceForeignKeysin interfaceDatabase
-
setEnforceForeignKeys
public void setEnforceForeignKeys(Boolean newEnforceForeignKeys)
Description copied from interface:DatabaseSets a new foreign-key enforcement policy. Ifnull, resets to the default value.- Specified by:
setEnforceForeignKeysin interfaceDatabase
-
isAllowAutoNumberInsert
public boolean isAllowAutoNumberInsert()
Description copied from interface:DatabaseGets 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 totrueallows the caller to optionally set the value explicitly when adding or updating rows (if a value is not provided, it will still be handled internally by the Table). This value can be set database-wide usingDatabase.setAllowAutoNumberInsert(java.lang.Boolean)and/or on a per-table basis usingTable.setAllowAutoNumberInsert(java.lang.Boolean)(and/or on a jvm-wide using theDatabase.ALLOW_AUTONUM_INSERT_PROPERTYsystem property). Note that enabling this feature should be done with care to reduce the chances of screwing up the database.- Specified by:
isAllowAutoNumberInsertin interfaceDatabase
-
setAllowAutoNumberInsert
public void setAllowAutoNumberInsert(Boolean allowAutoNumInsert)
Description copied from interface:DatabaseSets the new auto number insert policy for the database (unless overridden at the Table level). Ifnull, resets to the default value.- Specified by:
setAllowAutoNumberInsertin interfaceDatabase
-
isEvaluateExpressions
public boolean isEvaluateExpressions()
Description copied from interface:DatabaseGets the current expression evaluation policy. Expression evaluation is enabled by default but can be disabled if necessary.- Specified by:
isEvaluateExpressionsin interfaceDatabase
-
setEvaluateExpressions
public void setEvaluateExpressions(Boolean evaluateExpressions)
Description copied from interface:DatabaseSets the current expression evaluation policy. Expression evaluation is enabled by default but can be disabled if necessary. Ifnull, resets to the default value.- Specified by:
setEvaluateExpressionsin interfaceDatabase
-
isWriteBrokenIndex
public boolean isWriteBrokenIndex()
Description copied from interface:DatabaseGets the current write broken index policy. SeeDatabase.WRITE_BROKEN_INDEX_PROPERTYfor details.- Specified by:
isWriteBrokenIndexin interfaceDatabase
-
setWriteBrokenIndex
public void setWriteBrokenIndex(Boolean writeBrokenIndex)
Description copied from interface:DatabaseSets the current write broken index policy. Ifnull, resets to the default value.- Specified by:
setWriteBrokenIndexin interfaceDatabase
-
getColumnValidatorFactory
public ColumnValidatorFactory getColumnValidatorFactory()
Description copied from interface:DatabaseGets currently configured ColumnValidatorFactory (always non-null).- Specified by:
getColumnValidatorFactoryin interfaceDatabase
-
setColumnValidatorFactory
public void setColumnValidatorFactory(ColumnValidatorFactory newFactory)
Description copied from interface:DatabaseSets a new ColumnValidatorFactory. Ifnull, resets to the default value. The configured ColumnValidatorFactory will be used to create ColumnValidator instances on any user tables loaded from this point onward (this will not be used for system tables).- Specified by:
setColumnValidatorFactoryin interfaceDatabase
-
getEvalConfig
public EvalConfig getEvalConfig()
Description copied from interface:DatabaseReturns the EvalConfig for configuring expression evaluation.- Specified by:
getEvalConfigin interfaceDatabase
-
createDateFormat
public SimpleDateFormat createDateFormat(String formatStr)
Returns a SimpleDateFormat for the given format string which is configured with a compatible Calendar instance (seeDatabaseBuilder.toCompatibleCalendar(java.util.Calendar)) and this database'sTimeZone.
-
getFileFormat
public Database.FileFormat getFileFormat() throws IOException
Description copied from interface:DatabaseReturns the FileFormat of this database (which may involve inspecting the database itself).- Specified by:
getFileFormatin interfaceDatabase- Throws:
IOException
-
getDefaultSortOrder
public ColumnImpl.SortOrder getDefaultSortOrder() throws IOException
- Returns:
- the currently configured database default language sort order for textual columns
- Throws:
IOException- Usage:
- Intermediate: This method requires moderate API knowledge.
-
getDefaultCodePage
public short getDefaultCodePage() throws IOException- Returns:
- the currently configured database default code page for textual data (may not be relevant to all database versions)
- Throws:
IOException- Usage:
- Intermediate: This method requires moderate API knowledge.
-
readProperties
public PropertyMaps readProperties(byte[] propsBytes, int objectId, RowIdImpl rowId) throws IOException
- Returns:
- a PropertyMaps instance decoded from the given bytes (always
returns non-
nullresult). - Throws:
IOException- Usage:
- Intermediate: This method requires moderate API knowledge.
-
getTableNames
public Set<String> getTableNames() throws IOException
- Specified by:
getTableNamesin interfaceDatabase- Returns:
- The names of all of the user tables
- Throws:
IOException
-
getSystemTableNames
public Set<String> getSystemTableNames() throws IOException
- Specified by:
getSystemTableNamesin interfaceDatabase- Returns:
- The names of all of the system tables (String). Note, in order
to read these tables, you must use
Database.getSystemTable(java.lang.String). Extreme care should be taken if modifying these tables directly!. - Throws:
IOException
-
iterator
public Iterator<Table> iterator(TableIterableBuilder builder)
-
newIterable
public TableIterableBuilder newIterable()
Description copied from interface:DatabaseConvenience method for constructing a new TableIterableBuilder for this cursor. A TableIterableBuilder provides a variety of options for more flexible iteration of Tables.- Specified by:
newIterablein interfaceDatabase
-
newTableMetaDataIterable
public Iterable<TableMetaData> newTableMetaDataIterable()
- Specified by:
newTableMetaDataIterablein interfaceDatabase- Returns:
- an Iterable which returns an unmodifiable Iterator of the the TableMetaData for all tables in this Database.
-
getTable
public TableImpl getTable(String name) throws IOException
- Specified by:
getTablein interfaceDatabase- Parameters:
name- User table name (case-insensitive)- Returns:
- The Table, or null if it doesn't exist (or is a system table)
- Throws:
IOException
-
getTableMetaData
public TableMetaData getTableMetaData(String name) throws IOException
- Specified by:
getTableMetaDatain interfaceDatabase- Parameters:
name- Table name (case-insensitive), may be any table type (i.e. includes system or linked tables).- Returns:
- The meta data for the table, or null if it doesn't exist
- Throws:
IOException
-
getTable
public TableImpl getTable(int tableDefPageNumber) throws IOException
- Parameters:
tableDefPageNumber- the page number of a table definition- Returns:
- The table, or null if it doesn't exist
- Throws:
IOException- Usage:
- Advanced: This method is for advanced/internal use.
-
createTable
@Deprecated public void createTable(String name, List<ColumnBuilder> columns) throws IOException
Deprecated.useTableBuilderinsteadCreate a new table in this database- Parameters:
name- Name of the table to createcolumns- List of Columns in the table- Throws:
IOException
-
createTable
@Deprecated public void createTable(String name, List<ColumnBuilder> columns, List<IndexBuilder> indexes) throws IOException
Deprecated.useTableBuilderinsteadCreate a new table in this database- Parameters:
name- Name of the table to createcolumns- List of Columns in the tableindexes- List of IndexBuilders describing indexes for the table- Throws:
IOException
-
createLinkedTable
public void createLinkedTable(String name, String linkedDbName, String linkedTableName) throws IOException
Description copied from interface:DatabaseCreate a new table in this database- Specified by:
createLinkedTablein interfaceDatabase- Parameters:
name- Name of the table to create in this databaselinkedDbName- path to the linked databaselinkedTableName- name of the table in the linked database- Throws:
IOException
-
getRelationships
public List<Relationship> getRelationships(Table table1, Table table2) throws IOException
Description copied from interface:DatabaseFinds all the relationships in the database between the given tables.- Specified by:
getRelationshipsin interfaceDatabase- Throws:
IOException
-
getRelationships
public List<Relationship> getRelationships(TableImpl table1, TableImpl table2) throws IOException
- Throws:
IOException
-
getRelationships
public List<Relationship> getRelationships(Table table) throws IOException
Description copied from interface:DatabaseFinds all the relationships in the database for the given table.- Specified by:
getRelationshipsin interfaceDatabase- Throws:
IOException
-
getRelationships
public List<Relationship> getRelationships() throws IOException
Description copied from interface:DatabaseFinds 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.
- Specified by:
getRelationshipsin interfaceDatabase- Throws:
IOException
-
getSystemRelationships
public List<Relationship> getSystemRelationships() throws IOException
Description copied from interface:DatabaseFinds 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.
- Specified by:
getSystemRelationshipsin interfaceDatabase- Throws:
IOException
-
getQueries
public List<Query> getQueries() throws IOException
Description copied from interface:DatabaseFinds all the queries in the database.- Specified by:
getQueriesin interfaceDatabase- Throws:
IOException
-
getSystemTable
public TableImpl getSystemTable(String tableName) throws IOException
Description copied from interface:DatabaseReturns 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.
- Specified by:
getSystemTablein interfaceDatabase- Parameters:
tableName- Table name, may be a system table- Returns:
- The table, or
nullif it doesn't exist - Throws:
IOException
-
getDatabaseProperties
public PropertyMap getDatabaseProperties() throws IOException
- Specified by:
getDatabasePropertiesin interfaceDatabase- Returns:
- the core properties for the database
- Throws:
IOException
-
getSummaryProperties
public PropertyMap getSummaryProperties() throws IOException
- Specified by:
getSummaryPropertiesin interfaceDatabase- Returns:
- the summary properties for the database
- Throws:
IOException
-
getUserDefinedProperties
public PropertyMap getUserDefinedProperties() throws IOException
- Specified by:
getUserDefinedPropertiesin interfaceDatabase- Returns:
- the user-defined properties for the database
- Throws:
IOException
-
getPropertiesForObject
public PropertyMaps getPropertiesForObject(int objectId, com.healthmarketscience.jackcess.impl.PropertyMaps.Owner owner) throws IOException
- Returns:
- the PropertyMaps for the object with the given id
- Throws:
IOException- Usage:
- Advanced: This method is for advanced/internal use.
-
getDatabasePassword
public String getDatabasePassword() throws IOException
- Specified by:
getDatabasePasswordin interfaceDatabase- Returns:
- the current database password, or
nullif none set. - Throws:
IOException
-
flush
public void flush() throws IOExceptionDescription copied from interface:DatabaseFlushes any current changes to the database file (and any linked databases) to disk.- Specified by:
flushin interfaceDatabase- Specified by:
flushin interfaceFlushable- Throws:
IOException
-
close
public void close() throws IOExceptionDescription copied from interface:DatabaseClose 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).- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceDatabase- Throws:
IOException
-
validateNewTableName
public void validateNewTableName(String name) throws IOException
- Throws:
IOException
-
validateIdentifierName
public static void validateIdentifierName(String name, int maxLength, String identifierType)
Validates an identifier name. Names of fields, controls, and objects in Microsoft Access:- Can include any combination of letters, numbers, spaces, and special characters except a period (.), an exclamation point (!), an accent grave (`), and brackets ([ ]).
- Can't begin with leading spaces.
- Can't include control characters (ASCII values 0 through 31).
- Usage:
- Advanced: This method is for advanced/internal use.
-
toLookupName
public static String toLookupName(String name)
- Returns:
- a string usable in the _tableLookup map.
-
getDefaultTimeZone
public static TimeZone getDefaultTimeZone()
Returns the default TimeZone. This is normally the platform default TimeZone as returned byTimeZone.getDefault(), but can be overridden using the system property "com.healthmarketscience.jackcess.timeZone".- Usage:
- Advanced: This method is for advanced/internal use.
-
getDefaultCharset
public static Charset getDefaultCharset(JetFormat format)
Returns the default Charset for the given JetFormat. This may or may not be platform specific, depending on the format, but can be overridden using a system property composed of the prefix "com.healthmarketscience.jackcess.charset." followed by the JetFormat version to which the charset should apply, e.g."com.healthmarketscience.jackcess.charset.VERSION_3".- Usage:
- Advanced: This method is for advanced/internal use.
-
getDefaultColumnOrder
public static Table.ColumnOrder getDefaultColumnOrder()
Returns the default Table.ColumnOrder. This defaults toDatabase.DEFAULT_COLUMN_ORDER, but can be overridden using the system property "com.healthmarketscience.jackcess.columnOrder".- Usage:
- Advanced: This method is for advanced/internal use.
-
getDefaultEnforceForeignKeys
public static boolean getDefaultEnforceForeignKeys()
Returns the default enforce foreign-keys policy. This defaults totrue, but can be overridden using the system property "com.healthmarketscience.jackcess.enforceForeignKeys".- Usage:
- Advanced: This method is for advanced/internal use.
-
getDefaultAllowAutoNumberInsert
public static boolean getDefaultAllowAutoNumberInsert()
Returns the default allow auto number insert policy. This defaults tofalse, but can be overridden using the system property "com.healthmarketscience.jackcess.allowAutoNumberInsert".- Usage:
- Advanced: This method is for advanced/internal use.
-
getDefaultEvaluateExpressions
public static boolean getDefaultEvaluateExpressions()
Returns the default enable expression evaluation policy. This defaults totrue, but can be overridden using the system property "com.healthmarketscience.jackcess.enableExpressionEvaluation".- Usage:
- Advanced: This method is for advanced/internal use.
-
getDefaultWriteBrokenIndex
public static boolean getDefaultWriteBrokenIndex()
Returns the default allow broken index policy. This defaults tofalse, but can be overridden using the system property "com.healthmarketscience.jackcess.writeBrokenIndex".- Usage:
- Advanced: This method is for advanced/internal use.
-
getDefaultLinkResolver
public static LinkResolver getDefaultLinkResolver()
Returns the LinkResolver used when none has been configured on the Database. This defaults toLinkResolver.DEFAULT, which refuses to open linked databases. It can be changed toLinkResolver.UNRESTRICTEDusing the system property "com.healthmarketscience.jackcess.allowLinkResolution".- Usage:
- Advanced: This method is for advanced/internal use.
-
getDefaultDateTimeType
public static DateTimeType getDefaultDateTimeType()
Returns the default DateTimeType. This defaults toDateTimeType.LOCAL_DATE_TIME, but can be overridden using the system property "com.healthmarketscience.jackcess.dateTimeType".- Usage:
- Advanced: This method is for advanced/internal use.
-
getPasswordMask
public static byte[] getPasswordMask(ByteBuffer buffer, JetFormat format)
Returns the password mask retrieved from the given header page and format, ornullif this format does not use a password mask.- Usage:
- Advanced: This method is for advanced/internal use.
-
getFileFormatDetails
public static DatabaseImpl.FileFormatDetails getFileFormatDetails(Database.FileFormat fileFormat)
-
-