| Modifier and Type | Class and Description |
|---|---|
| private class | DatabaseImpl.
Normal table lookup handler, using catalog table index. |
| private class | DatabaseImpl.
Fallback table lookup handler, using catalog table scans. |
| public static class | DatabaseImpl.
Internal details for each FileFormat |
| private static class | DatabaseImpl.
Utility class for storing linked ODBC table info |
| private static class | DatabaseImpl.
Utility class for storing linked table info |
| private static class | DatabaseImpl.
Cache of currently in-use tables, allows re-use of existing tables. |
| private abstract class | DatabaseImpl.
Utility class for handling table lookups. |
| private static class | DatabaseImpl.
Utility class for storing table page number and actual name. |
| private class | DatabaseImpl.
Table iterator for this database, unmodifiable. |
| private static class | DatabaseImpl.
WeakReference for a Table which holds the table pageNumber (for later cache purging). |
| Modifier and Type | Field 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. | dtf
factory for the appropriate date/time type |
| private Integer | dynamicDbParentId
Id of the "Databases" container object in the system catalog, resolved dynamically during
|
| private static final Map | 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. | 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. | 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. | mfileFormat
the file format of the database |
| private final FKEnforcer. | mfkEnforcerSharedState
shared state used when enforcing foreign keys |
| private final JetFormat | mformat
Format that the containing database is in |
| private Map | 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 | mnewRelSIDs
SIDs to use for the ACEs added for new relationships |
| private final List | mnewTableSIDs
SIDs to use for the ACEs added for new tables |
| private final PageChannel | mpageChannel
Reads and writes database pages |
| private PropertyMaps. | 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 |
| private TableImpl | msystemCatalog
System catalog table |
| private final DatabaseImpl. | mtableCache
cache of in-use tables (or table definitions) |
| private DatabaseImpl. | mtableFinder
utility table finder |
| private final Map | 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 | 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 | SYSTEM_CATALOG_COLUMNS
the columns to read when reading system catalog normally |
| private static final Collection | SYSTEM_CATALOG_DATE_COLUMNS
the columns to read when grabbing dates |
| private static final Collection | SYSTEM_CATALOG_PROPS_COLUMNS
the columns to read when getting object properties |
| private static final Collection | 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 |
| Access | Constructor 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 autoSync, Database.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.version of new database (if known) fileFormat,Charset to use, if charset, TimeZone null, uses defaultTimeZone to use, if timeZone, CodecProvider provider, boolean readOnly, boolean ignoreSystemCatalogIndex)null, uses defaultCreate a new database by reading it in from a FileChannel. |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| 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 | |
| private void | addToAccessControlEntries(Integer objectId, Integer parentId, List<byte[]> sids)
Adds a new object to the system's access control entries |
| private void | |
| public void | |
| public void | close()
Implements io. 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.
version of new database. fileFormat,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 autoSync, Charset 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.Charset to use, if charset, TimeZone null, uses defaultTimeZone to use, if timeZone)null, uses defaultCreate 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 |
| public void | createLinkedTable(String name, String linkedDbName, String linkedTableName)
Implements io. 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. | |
| private static DatabaseImpl. | |
| public void | flush()
Implements io. 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)Returns the system Access Control Entries table (loaded on demand). |
| public Charset | getCharset()
Implements io. Gets currently configured Charset (always non- |
| public Table. | getColumnOrder()
Implements io. Gets currently configured |
| public ColumnValidatorFactory | getColumnValidatorFactory()
Implements io. Gets currently configured ColumnValidatorFactory (always non- |
| pack-priv LocalDateTime | |
| public String | getDatabasePassword()
Implements io. Returns the current database password, or |
| public PropertyMap | getDatabaseProperties()
Implements io. Returns the core properties for the database. |
| private LocalDateTime | |
| public ColumnImpl. | |
| public DateTimeType | getDateTimeType()
Implements io. Gets the currently configured DateTimeType. |
| private Integer | |
| public static boolean | |
| public static Charset | |
| public short | Returns: the currently configured database default code page for textual data (may not be relevant to all database versions)Returns the currently configured database default code page for textual data (may not be relevant to all database versions). |
| public static Table. | |
| public static DateTimeType | |
| public static boolean | |
| public static boolean | |
| public ColumnImpl. | Returns: the currently configured database default language sort order for textual columnsReturns the currently configured database default language sort order for textual columns. |
| public static TimeZone | |
| public static boolean | |
| private static <E extends Enum | |
| public ErrorHandler | getErrorHandler()
Implements io. Gets the currently configured ErrorHandler (always non- |
| public EvalConfig | getEvalConfig()
Implements io. Returns the EvalConfig for configuring expression evaluation. |
| pack-priv DBEvalContext | |
| public File | getFile()
Implements io. Returns the File underlying this Database |
| public Database. | getFileFormat()
Implements io. Returns the FileFormat of this database (which may involve inspecting the database itself). |
| public static DatabaseImpl. | |
| pack-priv FKEnforcer. | |
| public JetFormat | |
| public Map | getLinkedDatabases()
Implements io. 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. Gets the currently configured LinkResolver (always non- |
| public String | |
| private static String | |
| 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 |
| public Path | getPath()
Implements io. Returns the File underlying this Database |
| private PropertyMaps | |
| public PropertyMaps | Returns: the PropertyMaps for the object with the given idReturns the PropertyMaps for the object with the given id. |
| private PropertyMaps. | |
| public List | getQueries()
Implements io. Finds all the queries in the database. |
| public List | getRelationships(Table table1, Table table2)
Implements io. Finds all the relationships in the database between the given tables. |
| public List | |
| public List | getRelationships(Table table)
Implements io. Finds all the relationships in the database for the given table. |
| public List | getRelationships()
Implements io. Finds all the relationships in the database in non-system tables. |
| private List | |
| private TableImpl | |
| protected static InputStream | |
| public PropertyMap | getSummaryProperties()
Implements io. Returns the summary properties for the database. |
| public TableImpl | |
| public TableImpl | Returns: the complex column system table (loaded on demand)Returns the complex column system table (loaded on demand). |
| public List | getSystemRelationships()
Implements io. Finds all the relationships in the database, including system tables. |
| public TableImpl | getSystemTable(String tableName)
Implements io. Returns a reference to any available table in this access database, including system tables. |
| public Set | getSystemTableNames()
Implements io. Returns the names of all of the system tables (String). |
| public TableImpl | getTable(String name)
Implements io. 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 existthe page number of a table definition tableDefPageNumber)Returns the table, or null if it doesn't exist. |
| protected TableImpl | |
| private TableImpl | |
| private DatabaseImpl. | |
| public TableMetaData | getTableMetaData(String name)
Implements io. Returns the meta data for the table, or null if it doesn't exist. |
| public Set | getTableNames()
Implements io. Returns the names of all of the user tables. |
| private Set | |
| public TimeZone | getTimeZone()
Implements io. Gets currently configured TimeZone (always non- |
| pack-priv LocalDateTime | |
| public PropertyMap | getUserDefinedProperties()
Implements io. Returns the user-defined properties for the database. |
| public ZoneId | getZoneId()
Implements io. Gets currently configured ZoneId (always non- |
| private void | |
| private void | |
| public boolean | isAllowAutoNumberInsert()
Implements io. Gets current allow auto number insert policy. |
| private static boolean | |
| public boolean | isEnforceForeignKeys()
Implements io. Gets current foreign-key enforcement policy. |
| public boolean | isEvaluateExpressions()
Implements io. Gets the current expression evaluation policy. |
| public boolean | isLinkedTable(Table table)
Implements io. Returns |
| public boolean | |
| private static boolean | isSystemObject(int flags)
Returns: |
| private static boolean | |
| public boolean | isWriteBrokenIndex()
Implements io. Gets the current write broken index policy. |
| public Iterator | iterator()
Implements io. Returns an iterator over elements of type |
| public Iterator | |
| private TableImpl | |
| private DatabaseImpl. | |
| private boolean | |
| public TableIterableBuilder | newIterable()
Implements io. Convenience method for constructing a new TableIterableBuilder for this cursor. |
| public Iterable | newTableMetaDataIterable()
Implements io. 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 readOnly, FileChannel true, force opening file in read-only modepre-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 autoSync, Charset 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.Charset to use, if charset, TimeZone null, uses defaultTimeZone to use, if timeZone, CodecProvider null, uses defaultCodecProvider for handling page encoding/decoding, may be provider, boolean ignoreSystemCatalogIndex)null if no special encoding is necessaryOpen an existing Database. |
| pack-priv static FileChannel | Returns: a FileChannel on the given file.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).Returns a PropertyMaps instance decoded from the given bytes (always returns non- |
| private PropertyMaps | |
| private void | readSystemCatalog(boolean
if ignoreSystemCatalogIndex)true, skip the index cursor attempt and use a table scanReads and initialises the system catalog ( |
| private TableImpl | |
| private void | releaseSharedBuffer(ByteBuffer buffer)
Relinquishes use of a page ByteBuffer returned by |
| public void | setAllowAutoNumberInsert(Boolean allowAutoNumInsert)
Implements io. Sets the new auto number insert policy for the database (unless overridden at the Table level). |
| public void | setCharset(Charset newCharset)
Implements io. Sets a new Charset. |
| public void | setColumnOrder(Table.
Implements io. Sets a new Table.ColumnOrder. |
| public void | setColumnValidatorFactory(ColumnValidatorFactory newFactory)
Implements io. Sets a new ColumnValidatorFactory. |
| public void | setDateTimeType(DateTimeType dateTimeType)
Implements io. Sets the DateTimeType. |
| public void | setEnforceForeignKeys(Boolean newEnforceForeignKeys)
Implements io. Sets a new foreign-key enforcement policy. |
| public void | setErrorHandler(ErrorHandler newErrorHandler)
Implements io. Sets a new ErrorHandler. |
| public void | setEvaluateExpressions(Boolean evaluateExpressions)
Implements io. Sets the current expression evaluation policy. |
| public void | setLinkResolver(LinkResolver newLinkResolver)
Implements io. Sets a new LinkResolver. |
| public void | setTimeZone(TimeZone newTimeZone)
Implements io. Sets a new TimeZone. |
| public void | setWriteBrokenIndex(Boolean writeBrokenIndex)
Implements io. Sets the current write broken index policy. |
| public void | setZoneId(ZoneId newZoneId)
Implements io. Sets a new ZoneId. |
| private void | |
| private ByteBuffer | |
| public static String | Returns: upper-case name suitable for use as a map key, ornull if name is nullthe object name to normalise; may be name)nullConverts a table or object name to the canonical upper-case key used in the internal table-lookup cache. |
| public String | |
| public static void | transferDatabase(InputStream from, FileChannel to)
Copies the given database input stream |
| public static void | validateIdentifierName(String name, int maxLength, String identifierType)
Validates an identifier name. |
| private static void | |
| public void | |
| private String | |
| private static String | |
| pack-priv RelationshipImpl |