Database.
Simple example usage:
Database db = DatabaseBuilder.open(new File("test.mdb"));
Advanced example usage:
Database db = new DatabaseBuilder(new File("test.mdb"))
.setReadOnly(true)
.open();
| Modifier and Type | Field and Description |
|---|---|
| private boolean | autoSync
whether or not to auto-sync writes to the filesystem |
| private FileChannel | channel
optional pre-opened FileChannel, will _not_ be closed by Database close |
| private Charset | charset
optional charset for mdbs with unspecified charsets |
| private CodecProvider | codecProvider
optional CodecProvider for handling encoded mdbs |
| private Map | dbProps
database properties (if any) |
| private Database. | fileFormat
FileFormat to use when creating a new mdb |
| private boolean | ignoreBrokenSystemCatalogIndex
flag indicating that the system catalog index is borked |
| private Path | mdbFile
the file name of the mdb to open/create |
| private boolean | readOnly
whether or not to open existing mdb read-only |
| private Map | summaryProps
database summary properties (if any) |
| private TimeZone | timeZone
optional timezone override for interpreting dates |
| private Map | userProps
database user-defined (if any) |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Database | |
| public static Database | create(Database.
version of new database. fileFormat,Location to write the new database to. If this file already exists, it will be overwritten. mdbFile)Create a new Database for the given fileFormat |
| public static SimpleDateFormat | createDateFormat(String formatStr)
Returns a SimpleDateFormat for the given format string which is configured with a compatible Calendar instance
(see |
| public static ColumnBuilder | |
| public static ColumnBuilder | |
| public static DatabaseBuilder | |
| public static DatabaseBuilder | |
| public static DatabaseBuilder | |
| public static IndexBuilder | |
| public static IndexBuilder | |
| public static RelationshipBuilder | newRelationship(String fromTable, String toTable)
Convenience method for constructing a RelationshipBuilder. |
| public static RelationshipBuilder | newRelationship(Table fromTable, Table toTable)
Convenience method for constructing a RelationshipBuilder. |
| public static TableBuilder | |
| public static TableBuilder | |
| public Database | |
| public static Database | |
| public static Database | |
| public DatabaseBuilder | putDatabaseProperty(String name, Object value)
Sets the database property with the given name to the given value. |
| public DatabaseBuilder | putDatabaseProperty(String name, DataType type, Object value)
Sets the database property with the given name and type to the given value. |
| private static Map | |
| public DatabaseBuilder | putSummaryProperty(String name, Object value)
Sets the summary database property with the given name to the given value. |
| public DatabaseBuilder | putSummaryProperty(String name, DataType type, Object value)
Sets the summary database property with the given name and type to the given value. |
| public DatabaseBuilder | putUserDefinedProperty(String name, Object value)
Sets the user-defined database property with the given name to the given value. |
| public DatabaseBuilder | putUserDefinedProperty(String name, DataType type, Object value)
Sets the user-defined database property with the given name and type to the given value. |
| public static Calendar | toCompatibleCalendar(Calendar cal)
Ensures that the given |
| private static Path | |
| public DatabaseBuilder | |
| public DatabaseBuilder | |
| public DatabaseBuilder | |
| public DatabaseBuilder | withCodecProvider(CodecProvider newCodecProvider)
Sets the CodecProvider for handling page encoding/decoding, may be |
| public DatabaseBuilder | |
| public DatabaseBuilder | |
| public DatabaseBuilder | withIgnoreBrokenSystemCatalogIndex(boolean ignore)
Sets flag which, if |
| public DatabaseBuilder | |
| public DatabaseBuilder | withReadOnly(boolean newReadOnly)
Sets flag which, iff |
| public DatabaseBuilder | withTimeZone(TimeZone newTimeZone)
Sets the TimeZone to use for interpreting dates, if |
| autoSync | back to summary |
|---|---|
| private boolean autoSync whether or not to auto-sync writes to the filesystem | |
| channel | back to summary |
|---|---|
| private FileChannel channel optional pre-opened FileChannel, will _not_ be closed by Database close | |
| charset | back to summary |
|---|---|
| private Charset charset optional charset for mdbs with unspecified charsets | |
| codecProvider | back to summary |
|---|---|
| private CodecProvider codecProvider optional CodecProvider for handling encoded mdbs | |
| dbProps | back to summary |
|---|---|
| private Map<String, PropertyMap. database properties (if any) | |
| fileFormat | back to summary |
|---|---|
| private Database. FileFormat to use when creating a new mdb | |
| ignoreBrokenSystemCatalogIndex | back to summary |
|---|---|
| private boolean ignoreBrokenSystemCatalogIndex flag indicating that the system catalog index is borked | |
| mdbFile | back to summary |
|---|---|
| private Path mdbFile the file name of the mdb to open/create | |
| readOnly | back to summary |
|---|---|
| private boolean readOnly whether or not to open existing mdb read-only | |
| summaryProps | back to summary |
|---|---|
| private Map<String, PropertyMap. database summary properties (if any) | |
| timeZone | back to summary |
|---|---|
| private TimeZone timeZone optional timezone override for interpreting dates | |
| userProps | back to summary |
|---|---|
| private Map<String, PropertyMap. database user-defined (if any) | |
| DatabaseBuilder | back to summary |
|---|---|
| public DatabaseBuilder() | |
| DatabaseBuilder | back to summary |
|---|---|
| public DatabaseBuilder(File mdbFile)
Deprecated use
| |
| DatabaseBuilder | back to summary |
|---|---|
| public DatabaseBuilder(Path mdbFile)
Deprecated use
| |
| create | back to summary |
|---|---|
| public Database create() throws IOException Creates a new Database using the configured information.
| |
| create | back to summary |
|---|---|
| public static Database create(Database. Create a new Database for the given fileFormat
| |
| createDateFormat | back to summary |
|---|---|
| public static SimpleDateFormat createDateFormat(String formatStr) Returns a SimpleDateFormat for the given format string which is configured with a compatible Calendar instance
(see | |
| newColumn | back to summary |
|---|---|
| public static ColumnBuilder newColumn(String name) Convenience method for constructing a ColumnBuilder. | |
| newColumn | back to summary |
|---|---|
| public static ColumnBuilder newColumn(String name, DataType type) Convenience method for constructing a TableBuilder. | |
| newDatabase | back to summary |
|---|---|
| public static DatabaseBuilder newDatabase() Convenience method for constructing a DatabaseBuilder. | |
| newDatabase | back to summary |
|---|---|
| public static DatabaseBuilder newDatabase(Path path) Convenience method for constructing a DatabaseBuilder. | |
| newDatabase | back to summary |
|---|---|
| public static DatabaseBuilder newDatabase(File file) Convenience method for constructing a DatabaseBuilder. | |
| newIndex | back to summary |
|---|---|
| public static IndexBuilder newIndex(String name) Convenience method for constructing an IndexBuilder. | |
| newPrimaryKey | back to summary |
|---|---|
| public static IndexBuilder newPrimaryKey(String... colNames) Convenience method for constructing a primary key IndexBuilder. | |
| newRelationship | back to summary |
|---|---|
| public static RelationshipBuilder newRelationship(String fromTable, String toTable) Convenience method for constructing a RelationshipBuilder. | |
| newRelationship | back to summary |
|---|---|
| public static RelationshipBuilder newRelationship(Table fromTable, Table toTable) Convenience method for constructing a RelationshipBuilder. | |
| newTable | back to summary |
|---|---|
| public static TableBuilder newTable(String name) Convenience method for constructing a TableBuilder. | |
| newTable | back to summary |
|---|---|
| public static TableBuilder newTable(String name, boolean escapeIdentifiers) Convenience method for constructing a TableBuilder. | |
| open | back to summary |
|---|---|
| public Database open() throws IOException Opens an existing new Database using the configured information. | |
| open | back to summary |
|---|---|
| public static Database open(File mdbFile) throws IOException Open an existing Database. If the existing file is not writeable, the file will be opened read-only. Auto-syncing is enabled for the returned Database.
| |
| open | back to summary |
|---|---|
| public static Database open(Path mdbFile) throws IOException Open an existing Database. If the existing file is not writeable, the file will be opened read-only. Auto-syncing is enabled for the returned Database.
| |
| putDatabaseProperty | back to summary |
|---|---|
| public DatabaseBuilder putDatabaseProperty(String name, Object value) Sets the database property with the given name to the given value. Attempts to determine the type of the property
(see | |
| putDatabaseProperty | back to summary |
|---|---|
| public DatabaseBuilder putDatabaseProperty(String name, DataType type, Object value) Sets the database property with the given name and type to the given value. | |
| putProperty | back to summary |
|---|---|
| private static Map | |
| putSummaryProperty | back to summary |
|---|---|
| public DatabaseBuilder putSummaryProperty(String name, Object value) Sets the summary database property with the given name to the given value. Attempts to determine the type of the
property (see | |
| putSummaryProperty | back to summary |
|---|---|
| public DatabaseBuilder putSummaryProperty(String name, DataType type, Object value) Sets the summary database property with the given name and type to the given value. | |
| putUserDefinedProperty | back to summary |
|---|---|
| public DatabaseBuilder putUserDefinedProperty(String name, Object value) Sets the user-defined database property with the given name to the given value. Attempts to determine the type of
the property (see | |
| putUserDefinedProperty | back to summary |
|---|---|
| public DatabaseBuilder putUserDefinedProperty(String name, DataType type, Object value) Sets the user-defined database property with the given name and type to the given value. | |
| toCompatibleCalendar | back to summary |
|---|---|
| public static Calendar toCompatibleCalendar(Calendar cal) Ensures that the given | |
| toPath | back to summary |
|---|---|
| private static Path toPath(File file) | |
| withAutoSync | back to summary |
|---|---|
| public DatabaseBuilder withAutoSync(boolean newAutoSync) Sets whether or not to enable auto-syncing on write. if | |
| withChannel | back to summary |
|---|---|
| public DatabaseBuilder withChannel(FileChannel newChannel) Sets a pre-opened FileChannel. if provided explicitly, it will not be closed by the Database instance.
This allows ultimate control of where the mdb file exists (which may not be on disk, e.g.
| |
| withCharset | back to summary |
|---|---|
| public DatabaseBuilder withCharset(Charset newCharset) Sets the Charset to use, if | |
| withCodecProvider | back to summary |
|---|---|
| public DatabaseBuilder withCodecProvider(CodecProvider newCodecProvider) Sets the CodecProvider for handling page encoding/decoding, may be | |
| withFile | back to summary |
|---|---|
| public DatabaseBuilder withFile(File newMdbFile) File containing an existing database for | |
| withFileFormat | back to summary |
|---|---|
| public DatabaseBuilder withFileFormat(Database. Sets the version of new database ( | |
| withIgnoreBrokenSystemCatalogIndex | back to summary |
|---|---|
| public DatabaseBuilder withIgnoreBrokenSystemCatalogIndex(boolean ignore) Sets flag which, if | |
| withPath | back to summary |
|---|---|
| public DatabaseBuilder withPath(Path newMdbFile) File containing an existing database for | |
| withReadOnly | back to summary |
|---|---|
| public DatabaseBuilder withReadOnly(boolean newReadOnly) Sets flag which, iff | |
| withTimeZone | back to summary |
|---|---|
| public DatabaseBuilder withTimeZone(TimeZone newTimeZone) Sets the TimeZone to use for interpreting dates, if | |