|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.healthmarketscience.jackcess.DatabaseBuilder
public class DatabaseBuilder
Builder style class for opening/creating a Database.
Database db = DatabaseBuilder.open(new File("test.mdb"));
Advanced example usage:
Database db = new DatabaseBuilder(new File("test.mdb"))
.setReadOnly(true)
.open();
| Constructor Summary | |
|---|---|
DatabaseBuilder()
|
|
DatabaseBuilder(File mdbFile)
|
|
| Method Summary | |
|---|---|
Database |
create()
Creates a new Database using the configured information. |
static Database |
create(Database.FileFormat fileFormat,
File mdbFile)
Create a new Database for the given fileFormat |
Database |
open()
Opens an existingnew Database using the configured information. |
static Database |
open(File mdbFile)
Open an existing Database. |
DatabaseBuilder |
setAutoSync(boolean autoSync)
Sets whether or not to enable auto-syncing on write. |
DatabaseBuilder |
setChannel(FileChannel channel)
Sets a pre-opened FileChannel. |
DatabaseBuilder |
setCharset(Charset charset)
Sets the Charset to use, if null, uses default. |
DatabaseBuilder |
setCodecProvider(CodecProvider codecProvider)
Sets the CodecProvider for handling page encoding/decoding, may be null if no special encoding is necessary |
DatabaseBuilder |
setFile(File mdbFile)
File containing an existing database for open() or target file for
new database for create() (in which case, tf this file already
exists, it will be overwritten.) |
DatabaseBuilder |
setFileFormat(Database.FileFormat fileFormat)
Sets the version of new database ( create() only). |
DatabaseBuilder |
setReadOnly(boolean readOnly)
Sets flag which, iff true, will force opening file in
read-only mode (open() only). |
DatabaseBuilder |
setTimeZone(TimeZone timeZone)
Sets the TimeZone to use for interpreting dates, if null, uses
default |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatabaseBuilder()
public DatabaseBuilder(File mdbFile)
| Method Detail |
|---|
public DatabaseBuilder setFile(File mdbFile)
open() or target file for
new database for create() (in which case, tf this file already
exists, it will be overwritten.)
public DatabaseBuilder setReadOnly(boolean readOnly)
true, will force opening file in
read-only mode (open() only).
public DatabaseBuilder setAutoSync(boolean autoSync)
true,
write operations will be immediately flushed to disk upon completion.
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 Database.flush().
public DatabaseBuilder setCharset(Charset charset)
null, uses default.
public DatabaseBuilder setTimeZone(TimeZone timeZone)
null, uses
default
public DatabaseBuilder setCodecProvider(CodecProvider codecProvider)
null if no special encoding is necessary
public DatabaseBuilder setFileFormat(Database.FileFormat fileFormat)
create() only).
public DatabaseBuilder setChannel(FileChannel channel)
MemFileChannel). If provided, the File parameter will be
available from Database.getFile(), but otherwise ignored.
public Database open()
throws IOException
IOException
public Database create()
throws IOException
IOException
public static Database open(File mdbFile)
throws IOException
mdbFile - File containing the database
IOExceptionfor more flexible Database opening
public static Database create(Database.FileFormat fileFormat,
File mdbFile)
throws IOException
fileFormat - version of new database.mdbFile - Location to write the new database to. If this file
already exists, it will be overwritten.
IOExceptionfor more flexible Database creation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||