| java.lang.Object com.healthmarketscience.jackcess.Database
Field Summary | |
final public static boolean | DEFAULT_AUTO_SYNC default value for the auto-sync value (
true ). |
Constructor Summary | |
protected | Database(FileChannel channel, boolean autoSync) Create a new database by reading it in from a FileChannel.
Parameters: channel - File channel of the database. |
Method Summary | |
public void | close() | public void | copyTable(String name, ResultSet source) | public void | copyTable(String name, ResultSet source, ImportFilter filter) | public static Database | create(File mdbFile) Create a new Database
Parameters: mdbFile - Location to write the new database to. | public static Database | create(File mdbFile, boolean autoSync) Create a new Database
Parameters: mdbFile - Location to write the new database to. | public void | createTable(String name, List<Column> columns) | public void | flush() Flushes any current changes to the database file to disk. | public Table | getAccessControlEntries() | public JetFormat | getFormat() | public PageChannel | getPageChannel() | public List<Relationship> | getRelationships(Table table1, Table table2) Finds all the relationships in the database between the given tables. | public Table | getSystemCatalog() | public Table | getTable(String name) | public Set<String> | getTableNames() | public void | importFile(String name, File f, String delim) | public void | importFile(String name, File f, String delim, ImportFilter filter) | public void | importReader(String name, BufferedReader in, String delim) | public void | importReader(String name, BufferedReader in, String delim, ImportFilter filter) | public static boolean | isReservedWord(String s) | public Iterator<Table> | iterator() | public static Database | open(File mdbFile) Open an existing Database. | public static Database | open(File mdbFile, boolean readOnly) Open an existing Database. | public static Database | open(File mdbFile, boolean readOnly, boolean autoSync) Open an existing Database. | public String | toString() |
DEFAULT_AUTO_SYNC | final public static boolean DEFAULT_AUTO_SYNC(Code) | | default value for the auto-sync value (
true ). this is slower,
but leaves more chance of a useable database in the face of failures.
|
Database | protected Database(FileChannel channel, boolean autoSync) throws IOException(Code) | | Create a new database by reading it in from a FileChannel.
Parameters: channel - File channel of the database. This needs to be aFileChannel instead of a ReadableByteChannel because we need torandomly jump around to various points in the file. |
copyTable | public void copyTable(String name, ResultSet source) throws SQLException, IOException(Code) | | Copy an existing JDBC ResultSet into a new table in this database
Parameters: name - Name of the new table to create Parameters: source - ResultSet to copy from |
copyTable | public void copyTable(String name, ResultSet source, ImportFilter filter) throws SQLException, IOException(Code) | | Copy an existing JDBC ResultSet into a new table in this database
Parameters: name - Name of the new table to create Parameters: source - ResultSet to copy from Parameters: filter - valid import filter |
create | public static Database create(File mdbFile) throws IOException(Code) | | Create a new Database
Parameters: mdbFile - Location to write the new database to. If this filealready exists, it will be overwritten. |
create | public static Database create(File mdbFile, boolean autoSync) throws IOException(Code) | | Create a new Database
Parameters: mdbFile - Location to write the new database to. If this filealready exists, it will be overwritten. Parameters: autoSync - 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 stateon each write, but can be very inefficient for manyupdates. if false , flushing to disk happens atthe jvm's leisure, which can be much faster, but mayleave the database in an inconsistent state if failuresare encountered during writing. |
createTable | public void createTable(String name, List<Column> columns) throws IOException(Code) | | Create a new table in this database
Parameters: name - Name of the table to create Parameters: columns - List of Columns in the table |
flush | public void flush() throws IOException(Code) | | Flushes any current changes to the database file to disk.
|
getAccessControlEntries | public Table getAccessControlEntries()(Code) | | The system Access Control Entries table |
getSystemCatalog | public Table getSystemCatalog()(Code) | | The system catalog table |
getTableNames | public Set<String> getTableNames()(Code) | | The names of all of the user tables (String) |
importFile | public void importFile(String name, File f, String delim) throws IOException(Code) | | Copy a delimited text file into a new table in this database
Parameters: name - Name of the new table to create Parameters: f - Source file to import Parameters: delim - Regular expression representing the delimiter string. |
importFile | public void importFile(String name, File f, String delim, ImportFilter filter) throws IOException(Code) | | Copy a delimited text file into a new table in this database
Parameters: name - Name of the new table to create Parameters: f - Source file to import Parameters: delim - Regular expression representing the delimiter string. Parameters: filter - valid import filter |
importReader | public void importReader(String name, BufferedReader in, String delim) throws IOException(Code) | | Copy a delimited text file into a new table in this database
Parameters: name - Name of the new table to create Parameters: in - Source reader to import Parameters: delim - Regular expression representing the delimiter string. |
importReader | public void importReader(String name, BufferedReader in, String delim, ImportFilter filter) throws IOException(Code) | | Copy a delimited text file into a new table in this database
Parameters: name - Name of the new table to create Parameters: in - Source reader to import Parameters: delim - Regular expression representing the delimiter string. Parameters: filter - valid import filter |
isReservedWord | public static boolean isReservedWord(String s)(Code) | | true if the given string is a reserved word, false otherwise |
open | public static Database open(File mdbFile) throws IOException(Code) | | 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.
Parameters: mdbFile - File containing the database |
open | public static Database open(File mdbFile, boolean readOnly) throws IOException(Code) | | Open an existing Database. If the existing file is not writeable or the
readOnly flag is true , the file will be opened read-only.
Auto-syncing is enabled for the returned Database.
Parameters: mdbFile - File containing the database Parameters: readOnly - iff true , force opening file in read-onlymode |
open | public static Database open(File mdbFile, boolean readOnly, boolean autoSync) throws IOException(Code) | | Open an existing Database. If the existing file is not writeable or the
readOnly flag is true , the file will be opened read-only.
Parameters: mdbFile - File containing the database Parameters: readOnly - iff true , force opening file in read-onlymode Parameters: autoSync - 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 stateon each write, but can be very inefficient for manyupdates. if false , flushing to disk happens atthe jvm's leisure, which can be much faster, but mayleave the database in an inconsistent state if failuresare encountered during writing. |
|
|