APIdia Launch Partner
Top Inners Fields Constructors Methods
io.github.spannm.jackcess.impl

public Class DatabaseImpl

extends Object
implements Database, DateTimeContext
Class Inheritance
All Implemented Interfaces
io.github.spannm.jackcess.impl.DateTimeContext, io.github.spannm.jackcess.Database, java.io.Flushable, java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable
Known Direct Subclasses
io.github.spannm.jackcess.util.CustomLinkResolver.TempDatabaseImpl
Imports
io.github.spannm.jackcess.ColumnBuilder, .Cursor, .CursorBuilder, .DataType, .Database, .DatabaseBuilder, .DateTimeType, .Index, .IndexBuilder, .IndexCursor, .PropertyMap, .Relationship, .Row, .Table, .TableBuilder, .TableDefinition, .TableMetaData, io.github.spannm.jackcess.expr.EvalConfig, io.github.spannm.jackcess.impl.IndexData.ColumnDescriptor, io.github.spannm.jackcess.impl.query.QueryImpl, io.github.spannm.jackcess.query.Query, io.github.spannm.jackcess.util.CaseInsensitiveColumnMatcher, .ColumnValidatorFactory, .ErrorHandler, .LinkResolver, .ReadOnlyFileChannel, .SimpleColumnValidatorFactory, .StringUtil, .TableIterableBuilder, .ToStringBuilder, java.io.File, .FileNotFoundException, .IOException, .InputStream, .UncheckedIOException, java.lang.ref.ReferenceQueue, .WeakReference, java.nio.ByteBuffer, java.nio.channels.Channels, .FileChannel, .ReadableByteChannel, java.nio.charset.Charset, java.nio.file.Files, .OpenOption, .Path, .StandardOpenOption, java.text.SimpleDateFormat, java.time.LocalDateTime, .ZoneId, java.util.ArrayList, .Arrays, .Collection, .Collections, .Date, .EnumMap, .HashMap, .HashSet, .Iterator, .List, .Locale, .Map, .NoSuchElementException, .Optional, .Set, .TimeZone, .TreeSet, java.util.logging.Level, .Logger, java.util.regex.Pattern

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
DatabaseImpl.DefaultTableFinder

Normal table lookup handler, using catalog table index.

private class
DatabaseImpl.FallbackTableFinder

Fallback table lookup handler, using catalog table scans.

public static class
DatabaseImpl.FileFormatDetails

Internal details for each FileFormat

private static class
DatabaseImpl.LinkedODBCTableInfo

Utility class for storing linked ODBC table info

private static class
DatabaseImpl.LinkedTableInfo

Utility class for storing linked table info

private static class
DatabaseImpl.TableCache

Cache of currently in-use tables, allows re-use of existing tables.

private abstract class
DatabaseImpl.TableFinder

Utility class for handling table lookups.

private static class
DatabaseImpl.TableInfo

Utility class for storing table page number and actual name.

private class
DatabaseImpl.TableIterator

Table iterator for this database, unmodifiable.

private static class
DatabaseImpl.WeakTableReference

WeakReference for a Table which holds the table pageNumber (for later cache purging).

Field Summary

Modifier and TypeField and Description
private static final String
ACE_COL_ACM

ACE table column name of the actual access control entry

private static final String
ACE_COL_F_INHERITABLE

ACE table column name of the inheritable attributes flag

private static final String
ACE_COL_OBJECT_ID

ACE table column name of the relevant objectId

private static final String
ACE_COL_SID

ACE table column name of the relevant userId

pack-priv static final int
ALT_SYSTEM_OBJECT_FLAG

this object is another type of "system" object

private static final String
CAT_COL_CONNECT_NAME

System catalog column name of the remote connection name

private static final String
CAT_COL_DATABASE

System catalog column name of the remote database

private static final String
CAT_COL_DATE_CREATE

System catalog column name of the date a system object was created

private static final String
CAT_COL_DATE_UPDATE

System catalog column name of the date a system object was updated

private static final String
CAT_COL_FLAGS

System catalog column name of the flags column

private static final String
CAT_COL_FOREIGN_NAME

System catalog column name of the remote table name

private static final String
CAT_COL_ID

System catalog column name of the page on which system object definitions are stored

private static final String
CAT_COL_NAME

System catalog column name of the name of a system object

private static final String
private static final String
CAT_COL_PARENT_ID

System catalog column name of a system object's parent's id

pack-priv static final String
CAT_COL_PROPS

System catalog column name of the properties column

private static final String
CAT_COL_TYPE

System catalog column name of the type of a system object

private static final int
DB_PARENT_ID

top-level parentid for a database

public static final String
DEFAULT_RESOURCE_PATH

the default value for the resource path used to load classpath resources.

private ColumnImpl.DateTimeFactory
dtf

factory for the appropriate date/time type

private Integer
dynamicDbParentId

Id of the "Databases" container object in the system catalog, resolved dynamically during readSystemCatalog when the catalog index is unavailable (e.g. Turkish / LCID 1055).

private static final Map<Database.FileFormat, DatabaseImpl.FileFormatDetails>
FILE_FORMAT_DETAILS

additional internal details about each FileFormat

public static final int
HIDDEN_OBJECT_FLAG

this object is hidden

private static final Pattern
INVALID_IDENTIFIER_CHARS

regex matching characters which are invalid in identifier names

private static final Logger
private TableImpl
maccessControlEntries

System access control entries table (initialized on first use)

private boolean
mallowAutoNumInsert

whether or not auto numbers can be directly inserted by the user

private static final int
MAX_CACHED_LOOKUP_TABLES

max number of table lookups to cache

private static final long
MAX_SIZE_EMPTY_DB

the maximum size of any of the included "empty db" resources

private ByteBuffer
mbuffer

Buffer to hold database pages

private Charset
mcharset

charset to use when handling text

private Table.ColumnOrder
mcolumnOrder

the ordering used for table columns

private TableImpl
mcomplexCols

System complex columns table (initialized on first use)

private ErrorHandler
mdbErrorHandler

optional error handler to use when row errors are encountered

private Integer
mdbParentId

ID of the Databases system object

private PropertyMaps
mdbPropMaps

core database properties

private Short
mdefaultCodePage

default code page to be used for textual columns (in some dbs)

private ColumnImpl.SortOrder
mdefaultSortOrder

language sort order to be used for textual columns

private boolean
menforceForeignKeys

whether or not enforcement of foreign-keys is enabled

private DBEvalContext
mevalCtx

shared context for evaluating expressions

private boolean
mevaluateExpressions

whether or not to evaluate expressions

private final Path
mfile

the File of the database

private Database.FileFormat
mfileFormat

the file format of the database

private final FKEnforcer.SharedState
mfkEnforcerSharedState

shared state used when enforcing foreign keys

private final JetFormat
mformat

Format that the containing database is in

private Map<String, Database>
mlinkedDbs

any linked databases which have been opened

private LinkResolver
mlinkResolver

linked table resolver

private final String
mname

the simple name of the database

private byte[]
mnewObjOwner

owner of objects we create

private final List<byte[]>
mnewRelSIDs

SIDs to use for the ACEs added for new relationships

private final List<byte[]>
mnewTableSIDs

SIDs to use for the ACEs added for new tables

private final PageChannel
mpageChannel

Reads and writes database pages

private PropertyMaps.Handler
mpropsHandler

handler for reading/writing properties

private TableImpl
mqueries

System queries table (initialized on first use)

private final boolean
mreadOnly

whether or not this db is read-only

private TableImpl
mrelationships

System relationships table (initialized on first use)

private Integer
mrelParentId

ID of the Relationships system object

private PropertyMaps
msummaryPropMaps

summary properties

private Integer
msysParentId

ParentId of MSysObjects itself within the system catalog, resolved during readSystemCatalog when the catalog index is unavailable (e.g. Turkish / LCID 1055).

private TableImpl
msystemCatalog

System catalog table

private final DatabaseImpl.TableCache
mtableCache

cache of in-use tables (or table definitions)

private DatabaseImpl.TableFinder
mtableFinder

utility table finder

private final Map<String, DatabaseImpl.TableInfo>
mtableLookup

Cache map of UPPERCASE table names to page numbers containing their definition and their stored table name (max size MAX_CACHED_LOOKUP_TABLES).

private Set<String>
mtableNames

set of table names as stored in the mdb file, created on demand

private Integer
mtableParentId

ID of the Tables system object

private TimeZone
mtimeZone

timezone to use when handling dates

private PropertyMaps
muserDefPropMaps

user-defined properties

private ColumnValidatorFactory
mvalidatorFactory

factory for ColumnValidators

private boolean
mwriteBrokenIndex

whether or not to allow writing indexes with unsupported sort orders

private ZoneId
mzoneId

zoneId to use when handling dates

private static final String
OBJECT_NAME_DB_PROPS

Name of the main database properties object

private static final String
OBJECT_NAME_SUMMARY_PROPS

Name of the summary properties object

private static final String
OBJECT_NAME_USERDEF_PROPS

Name of the user-defined properties object

private static final Pattern
ODBC_PWD_PATTERN

regex to match a password in an ODBC string

private static final int
PAGE_SYSTEM_CATALOG

System catalog always lives on page 2

private static final String
REL_COL_COLUMN_COUNT

Relationship table column name of the column count

private static final String
REL_COL_COLUMN_INDEX

Relationship table column name of the index of the columns

private static final String
REL_COL_FLAGS

Relationship table column name of the flags

private static final String
REL_COL_FROM_COLUMN

Relationship table column name of the "from" column name

private static final String
REL_COL_FROM_TABLE

Relationship table column name of the "from" table name

private static final String
REL_COL_NAME

Relationship table column name of the relationship

private static final String
REL_COL_TO_COLUMN

Relationship table column name of the "to" column name

private static final String
REL_COL_TO_TABLE

Relationship table column name of the "to" table name

pack-priv static final String
RESOURCE_PATH

the resource path to be used when loading classpath resources

public static final OpenOption[]
RO_CHANNEL_OPTS

read-only channel access mode

public static final OpenOption[]
RW_CHANNEL_OPTS

read/write channel access mode for existing files

public static final OpenOption[]
RWC_CHANNEL_OPTS

read/write/create channel access mode for new files

private static final byte[]
SYS_DEFAULT_SID

this is the default "userId" used if we cannot find existing info.

private static final Integer
SYS_FULL_ACCESS_ACM

this is the access control bit field for created tables.

private static final Collection<String>
SYSTEM_CATALOG_COLUMNS

the columns to read when reading system catalog normally

private static final Collection<String>
SYSTEM_CATALOG_DATE_COLUMNS

the columns to read when grabbing dates

private static final Collection<String>
SYSTEM_CATALOG_PROPS_COLUMNS

the columns to read when getting object properties

private static final Collection<String>
SYSTEM_CATALOG_TABLE_DETAIL_COLUMNS

the columns to read when finding table details

pack-priv static final int
SYSTEM_OBJECT_FLAG

this object is a "system" object

pack-priv static final int
SYSTEM_OBJECT_FLAGS

all flags which seem to indicate some type of system object

private static final String
SYSTEM_OBJECT_NAME_DATABASES

Name of the system object that is the parent of all databases

private static final String
SYSTEM_OBJECT_NAME_RELATIONSHIPS

Name of the system object that is the parent of all relationships

private static final String
SYSTEM_OBJECT_NAME_TABLES

Name of the system object that is the parent of all tables

private static final String
TABLE_SYSTEM_ACES

Name of the table that contains system access control entries

private static final String
TABLE_SYSTEM_CATALOG

Name of the system catalog

private static final String
TABLE_SYSTEM_COMPLEX_COLS

Name of the table that contains complex type information

private static final String
TABLE_SYSTEM_QUERIES

Name of the table that contains queries

private static final String
TABLE_SYSTEM_RELATIONSHIPS

Name of the table that contains table relationships

private static final Short
TYPE_LINKED_ODBC_TABLE

System object type for linked odbc tables

private static final Short
TYPE_LINKED_TABLE

System object type for linked table definitions

private static final Short
TYPE_QUERY

System object type for query definitions

private static final Short
TYPE_RELATIONSHIP

System object type for relationships

pack-priv static final Short
TYPE_TABLE

System object type for table definitions

Constructor Summary

AccessConstructor and Description
protected
DatabaseImpl(Path
the File to which the channel is connected
file
,
FileChannel
File channel of the database. This needs to be a FileChannel instead of a ReadableByteChannel because we need to randomly jump around to various points in the file.
channel
,
boolean closeChannel, boolean
whether or not to enable auto-syncing on write. if true, 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. if false, 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 using flush.
autoSync
,
Database.FileFormat
version of new database (if known)
fileFormat
,
Charset
Charset to use, if null, uses default
charset
,
TimeZone
TimeZone to use, if null, uses default
timeZone
,
CodecProvider provider, boolean readOnly, boolean ignoreSystemCatalogIndex)

Create a new database by reading it in from a FileChannel.

Method Summary

Modifier and TypeMethod and Description
private static void
addFileFormatDetails(Database.FileFormat fileFormat, String emptyFileName, JetFormat format)

pack-priv void
addNewTable(String name, int tdefPageNumber, Short type, String linkedDbName, String linkedTableName)

Adds a newly created table to the relevant internal database structures.

private void
addTable(String tableName, Integer pageNumber, Short type, String linkedDbName, String linkedTableName)

Adds a table to the _tableLookup and resets the _tableNames set

private void
addToAccessControlEntries(Integer objectId, Integer parentId, List<byte[]> sids)

Adds a new object to the system's access control entries

private void
addToSystemCatalog(String
Table name
name
,
int
id of the new object
objectId
,
Short type, String linkedDbName, String linkedTableName, Integer parentId)

Add a new table to the system catalog

public void
public void
close()

Implements io.github.spannm.jackcess.Database.close.

Close the database file (and any linked databases).

private void
collectNewObjectSIDs(Integer parentId, List<byte[]> sids)

Find collection of SIDs for the given parent id.

private void
collectRelationships(Cursor cursor, TableImpl fromTable, TableImpl toTable, List<Relationship> relationships, boolean includeSystemTables)

Finds the relationships matching the given from and to tables from the given cursor and adds them to the given list.

public static DatabaseImpl
create(Database.FileFormat
version of new database.
fileFormat
,
Path
Location to write the new database to. If this file already exists, it will be overwritten.
mdbFile
,
FileChannel
pre-opened FileChannel. if provided explicitly, it will not be closed by this Database instance
channel
,
boolean
whether or not to enable auto-syncing on write. if true, 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. if false, 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 using flush.
autoSync
,
Charset
Charset to use, if null, uses default
charset
,
TimeZone
TimeZone to use, if null, uses default
timeZone
)

Create a new Database for the given fileFormat

private Cursor
createCursorWithOptionalIndex(TableImpl table, String colName, Object colValue)

Creates a Cursor restricted to the given column value if possible (using an existing index), otherwise a simple table cursor.

public SimpleDateFormat
createDateFormat(String formatStr)

Returns a SimpleDateFormat for the given format string which is configured with a compatible Calendar instance (see DatabaseBuilder#toCompatibleCalendar) and this database's TimeZone.

public void
createLinkedTable(String name, String linkedDbName, String linkedTableName)

Implements io.github.spannm.jackcess.Database.createLinkedTable.

Create a new table in this database

private String
public void
createTable(String
Name of the table to create
name
,
List<ColumnBuilder>
List of Columns in the table
columns
)
Deprecated use TableBuilder instead

Create a new table in this database

public void
createTable(String
Name of the table to create
name
,
List<ColumnBuilder>
List of Columns in the table
columns
,
List<IndexBuilder>
List of IndexBuilders describing indexes for the table
indexes
)
Deprecated use TableBuilder instead

Create a new table in this database

private static DatabaseImpl.TableInfo
createTableInfo(String tableName, Short type, Row row)

private static DatabaseImpl.TableInfo
createTableInfo(String tableName, Integer pageNumber, int flags, Short type, String linkedDbName, String linkedTableName, String connectName)

Creates a TableInfo instance appropriate for the given table data.

public void
flush()

Implements io.github.spannm.jackcess.Database.flush.

Flushes any current changes to the database file (and any linked databases) to disk.

public TableImpl

Returns:

The system Access Control Entries table (loaded on demand)
getAccessControlEntries
()

Returns the system Access Control Entries table (loaded on demand).

public Charset
getCharset()

Implements io.github.spannm.jackcess.Database.getCharset.

Gets currently configured Charset (always non-null).

public Table.ColumnOrder
getColumnOrder()

Implements io.github.spannm.jackcess.Database.getColumnOrder.

Gets currently configured Table.ColumnOrder (always non-null).

public ColumnValidatorFactory
getColumnValidatorFactory()

Implements io.github.spannm.jackcess.Database.getColumnValidatorFactory.

Gets currently configured ColumnValidatorFactory (always non-null).

pack-priv LocalDateTime
getCreateDateForObject(int objectId)

public String
getDatabasePassword()

Implements io.github.spannm.jackcess.Database.getDatabasePassword.

Returns the current database password, or null if none set.

public PropertyMap
getDatabaseProperties()

Implements io.github.spannm.jackcess.Database.getDatabaseProperties.

Returns the core properties for the database.

private LocalDateTime
getDateForObject(int objectId, String dateCol)

public ColumnImpl.DateTimeFactory
public DateTimeType
getDateTimeType()

Implements io.github.spannm.jackcess.Database.getDateTimeType.

Gets the currently configured DateTimeType.

private Integer
public static boolean
getDefaultAllowAutoNumberInsert()

Returns the default allow auto number insert policy.

public static Charset
getDefaultCharset(JetFormat format)

Returns the default Charset for the given JetFormat.

public short

Returns:

the currently configured database default code page for textual data (may not be relevant to all database versions)
getDefaultCodePage
()

Returns the currently configured database default code page for textual data (may not be relevant to all database versions).

public static Table.ColumnOrder
getDefaultColumnOrder()

Returns the default Table.ColumnOrder.

public static DateTimeType
getDefaultDateTimeType()

Returns the default DateTimeType.

public static boolean
getDefaultEnforceForeignKeys()

Returns the default enforce foreign-keys policy.

public static boolean
getDefaultEvaluateExpressions()

Returns the default enable expression evaluation policy.

public ColumnImpl.SortOrder

Returns:

the currently configured database default language sort order for textual columns
getDefaultSortOrder
()

Returns the currently configured database default language sort order for textual columns.

public static TimeZone
getDefaultTimeZone()

Returns the default TimeZone.

public static boolean
getDefaultWriteBrokenIndex()

Returns the default write broken index policy.

private static <E extends Enum<E>> E
getEnumSystemProperty(Class<E> enumClass, String propName, E defaultValue)

public ErrorHandler
getErrorHandler()

Implements io.github.spannm.jackcess.Database.getErrorHandler.

Gets the currently configured ErrorHandler (always non-null).

public EvalConfig
getEvalConfig()

Implements io.github.spannm.jackcess.Database.getEvalConfig.

Returns the EvalConfig for configuring expression evaluation.

pack-priv DBEvalContext
public File
getFile()

Implements io.github.spannm.jackcess.Database.getFile.

Returns the File underlying this Database

public Database.FileFormat
getFileFormat()

Implements io.github.spannm.jackcess.Database.getFileFormat.

Returns the FileFormat of this database (which may involve inspecting the database itself).

public static DatabaseImpl.FileFormatDetails
pack-priv FKEnforcer.SharedState
public JetFormat
public Map<String, Database>
getLinkedDatabases()

Implements io.github.spannm.jackcess.Database.getLinkedDatabases.

Returns an unmodifiable view of the currently loaded linked databases, mapped from the linked database file name to the linked database.

public LinkResolver
getLinkResolver()

Implements io.github.spannm.jackcess.Database.getLinkResolver.

Gets the currently configured LinkResolver (always non-null).

public String
private static String
getName(Path file)

private byte[]
public PageChannel
public static byte[]
getPasswordMask(ByteBuffer buffer, JetFormat format)

Returns the password mask retrieved from the given header page and format, or null if this format does not use a password mask.

public Path
getPath()

Implements io.github.spannm.jackcess.Database.getPath.

Returns the File underlying this Database

private PropertyMaps
getPropertiesForDbObject(String dbName)

Returns: property group for the given "database" object

public PropertyMaps

Returns:

the PropertyMaps for the object with the given id
getPropertiesForObject
(int objectId, PropertyMaps.Owner owner)

Returns the PropertyMaps for the object with the given id.

private PropertyMaps.Handler
getPropsHandler()

Returns: the current handler for reading/writing properties, creating if necessary

public List<Query>
getQueries()

Implements io.github.spannm.jackcess.Database.getQueries.

Finds all the queries in the database.

public List<Relationship>
getRelationships(Table table1, Table table2)

Implements io.github.spannm.jackcess.Database.getRelationships.

Finds all the relationships in the database between the given tables.

public List<Relationship>
public List<Relationship>
getRelationships(Table table)

Implements io.github.spannm.jackcess.Database.getRelationships.

Finds all the relationships in the database for the given table.

public List<Relationship>
getRelationships()

Implements io.github.spannm.jackcess.Database.getRelationships.

Finds all the relationships in the database in non-system tables.

private List<Relationship>
getRelationshipsImpl(TableImpl table1, TableImpl table2, boolean includeSystemTables)

private TableImpl
protected static InputStream
public PropertyMap
getSummaryProperties()

Implements io.github.spannm.jackcess.Database.getSummaryProperties.

Returns the summary properties for the database.

public TableImpl

Returns:

The system catalog table
getSystemCatalog
()

Returns the system catalog table.

public TableImpl

Returns:

the complex column system table (loaded on demand)
getSystemComplexColumns
()

Returns the complex column system table (loaded on demand).

public List<Relationship>
getSystemRelationships()

Implements io.github.spannm.jackcess.Database.getSystemRelationships.

Finds all the relationships in the database, including system tables.

public TableImpl
getSystemTable(String tableName)

Implements io.github.spannm.jackcess.Database.getSystemTable.

Returns a reference to any available table in this access database, including system tables.

public Set<String>
getSystemTableNames()

Implements io.github.spannm.jackcess.Database.getSystemTableNames.

Returns the names of all of the system tables (String).

public TableImpl
getTable(String name)

Implements io.github.spannm.jackcess.Database.getTable.

Returns the Table, or null if it doesn't exist (or is a system table).

public TableImpl

Returns:

The table, or null if it doesn't exist
getTable
(int
the page number of a table definition
tableDefPageNumber
)

Returns the table, or null if it doesn't exist.

protected TableImpl

Returns:

The table, or null if it doesn't exist
getTable
(String
Table name
name
,
boolean
whether to consider returning a system table
includeSystemTables
)

Returns the table, or null if it doesn't exist.

private TableImpl
getTable(DatabaseImpl.TableInfo tableInfo, boolean includeSystemTables)

private DatabaseImpl.TableInfo
getTableInfo(String name, boolean includeSystemTables)

public TableMetaData
getTableMetaData(String name)

Implements io.github.spannm.jackcess.Database.getTableMetaData.

Returns the meta data for the table, or null if it doesn't exist.

public Set<String>
getTableNames()

Implements io.github.spannm.jackcess.Database.getTableNames.

Returns the names of all of the user tables.

private Set<String>
getTableNames(boolean normalTables, boolean systemTables, boolean linkedTables)

public TimeZone
getTimeZone()

Implements io.github.spannm.jackcess.Database.getTimeZone, io.github.spannm.jackcess.impl.DateTimeContext.getTimeZone.

Gets currently configured TimeZone (always non-null and aligned with the ZoneId).

pack-priv LocalDateTime
getUpdateDateForObject(int objectId)

public PropertyMap
getUserDefinedProperties()

Implements io.github.spannm.jackcess.Database.getUserDefinedProperties.

Returns the user-defined properties for the database.

public ZoneId
getZoneId()

Implements io.github.spannm.jackcess.Database.getZoneId, io.github.spannm.jackcess.impl.DateTimeContext.getZoneId.

Gets currently configured ZoneId (always non-null and aligned with the TimeZone).

private void
private void
initRootPageInfo()

Reads various config info from the db page 0.

public boolean
isAllowAutoNumberInsert()

Implements io.github.spannm.jackcess.Database.isAllowAutoNumberInsert.

Gets current allow auto number insert policy.

private static boolean
public boolean
isEnforceForeignKeys()

Implements io.github.spannm.jackcess.Database.isEnforceForeignKeys.

Gets current foreign-key enforcement policy.

public boolean
isEvaluateExpressions()

Implements io.github.spannm.jackcess.Database.isEvaluateExpressions.

Gets the current expression evaluation policy.

public boolean
isLinkedTable(Table table)

Implements io.github.spannm.jackcess.Database.isLinkedTable.

Returns true if this Database links to the given Table, false otherwise.

public boolean
private static boolean
isSystemObject(int flags)

Returns: true if the given flags indicate that an object is some sort of system object, false otherwise.

private static boolean
isTableType(Short objType)

public boolean
isWriteBrokenIndex()

Implements io.github.spannm.jackcess.Database.isWriteBrokenIndex.

Gets the current write broken index policy.

public Iterator<Table>
iterator()

Implements io.github.spannm.jackcess.Database.iterator.

Returns an iterator over elements of type T.

public Iterator<Table>
private TableImpl
loadTable(String name, int pageNumber, int flags, Short type)

Reads a table with the given name from the given pageNumber.

private DatabaseImpl.TableInfo
lookupTable(String tableName)

Returns: the tableInfo of the given table, if any

private boolean
matchesLinkedTable(Table table, String linkedTableName, String linkedDbName)

public TableIterableBuilder
newIterable()

Implements io.github.spannm.jackcess.Database.newIterable.

Convenience method for constructing a new TableIterableBuilder for this cursor.

public Iterable<TableMetaData>
newTableMetaDataIterable()

Implements io.github.spannm.jackcess.Database.newTableMetaDataIterable.

Returns an Iterable which returns an unmodifiable Iterator of the the TableMetaData for all tables in this Database.

public static DatabaseImpl
open(Path
File containing the database
mdbFile
,
boolean
iff true, force opening file in read-only mode
readOnly
,
FileChannel
pre-opened FileChannel. if provided explicitly, it will not be closed by this Database instance
channel
,
boolean
whether or not to enable auto-syncing on write. if true, 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. if false, 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 using flush.
autoSync
,
Charset
Charset to use, if null, uses default
charset
,
TimeZone
TimeZone to use, if null, uses default
timeZone
,
CodecProvider
CodecProvider for handling page encoding/decoding, may be null if no special encoding is necessary
provider
,
boolean ignoreSystemCatalogIndex)

Open an existing Database.

pack-priv static FileChannel

Returns:

a FileChannel on the given file.
openChannel
(Path
file to open
mdbFile
,
boolean
true if read-only
readOnly
,
boolean create)

Package visible only to support unit tests via DatabaseTest.openChannel().

public PropertyMaps

Returns:

a PropertyMaps instance decoded from the given bytes (always returns non-null result).
readProperties
(byte[] propsBytes, int objectId, RowIdImpl rowId)

Returns a PropertyMaps instance decoded from the given bytes (always returns non-null result).

private PropertyMaps
readProperties(int objectId, Row objectRow, PropertyMaps.Owner owner)

private void
readSystemCatalog(boolean
if true, skip the index cursor attempt and use a table scan
ignoreSystemCatalogIndex
)

Reads and initialises the system catalog (MSysObjects).

private TableImpl
readTable(String name, int pageNumber, int flags, Short type)

Reads a table with the given name from the given pageNumber.

private void
releaseSharedBuffer(ByteBuffer buffer)

Relinquishes use of a page ByteBuffer returned by takeSharedBuffer.

public void
setAllowAutoNumberInsert(Boolean allowAutoNumInsert)

Implements io.github.spannm.jackcess.Database.setAllowAutoNumberInsert.

Sets the new auto number insert policy for the database (unless overridden at the Table level).

public void
setCharset(Charset newCharset)

Implements io.github.spannm.jackcess.Database.setCharset.

Sets a new Charset.

public void
setColumnOrder(Table.ColumnOrder newColumnOrder)

Implements io.github.spannm.jackcess.Database.setColumnOrder.

Sets a new Table.ColumnOrder.

public void
public void
public void
setEnforceForeignKeys(Boolean newEnforceForeignKeys)

Implements io.github.spannm.jackcess.Database.setEnforceForeignKeys.

Sets a new foreign-key enforcement policy.

public void
setErrorHandler(ErrorHandler newErrorHandler)

Implements io.github.spannm.jackcess.Database.setErrorHandler.

Sets a new ErrorHandler.

public void
setEvaluateExpressions(Boolean evaluateExpressions)

Implements io.github.spannm.jackcess.Database.setEvaluateExpressions.

Sets the current expression evaluation policy.

public void
setLinkResolver(LinkResolver newLinkResolver)

Implements io.github.spannm.jackcess.Database.setLinkResolver.

Sets a new LinkResolver.

public void
setTimeZone(TimeZone newTimeZone)

Implements io.github.spannm.jackcess.Database.setTimeZone.

Sets a new TimeZone.

public void
setWriteBrokenIndex(Boolean writeBrokenIndex)

Implements io.github.spannm.jackcess.Database.setWriteBrokenIndex.

Sets the current write broken index policy.

public void
setZoneId(ZoneId newZoneId)

Implements io.github.spannm.jackcess.Database.setZoneId.

Sets a new ZoneId.

private void
setZoneInfo(TimeZone newTimeZone, ZoneId newZoneId)

private ByteBuffer
takeSharedBuffer()

Returns: a (possibly cached) page ByteBuffer for internal use.

public static String

Returns:

upper-case name suitable for use as a map key, or null if name is null
toLookupName
(String
the object name to normalise; may be null
name
)

Converts a table or object name to the canonical upper-case key used in the internal table-lookup cache.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public static void
transferDatabase(InputStream from, FileChannel to)

Copies the given database input stream from to the given channel to.

public static void
validateIdentifierName(String name, int maxLength, String identifierType)

Validates an identifier name.

private static void
validateName(String name, int maxLength, String nameType)

Validates a name.

public void
private String
private static String
pack-priv RelationshipImpl
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait