Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013

com.healthmarketscience.jackcess
Class Database

java.lang.Object
  extended by com.healthmarketscience.jackcess.Database
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Iterable<Table>

public class Database
extends java.lang.Object
implements java.lang.Iterable<Table>, java.io.Closeable, java.io.Flushable

An Access database.

There is optional support for large indexes (enabled by default). This optional support can be disabled via a few different means:


Nested Class Summary
static class Database.FileFormat
          Enum which indicates which version of Access created the database.
 
Field Summary
static java.lang.String BROKEN_NIO_PROPERTY
          (boolean) system property which can be used to indicate that the current vm has a poor nio implementation (specifically for FileChannel.transferFrom)
static java.lang.String CHARSET_PROPERTY_PREFIX
          system property prefix which can be used to set the default Charset used for text data (full property includes the JetFormat version).
static java.lang.String COLUMN_ORDER_PROPERTY
          system property which can be used to set the default sort order for table columns.
static boolean DEFAULT_AUTO_SYNC
          default value for the auto-sync value (true). this is slower, but leaves more chance of a useable database in the face of failures.
static Table.ColumnOrder DEFAULT_COLUMN_ORDER
          the default sort order for table columns.
static ErrorHandler DEFAULT_ERROR_HANDLER
          default error handler used if none provided (just rethrows exception)
static LinkResolver DEFAULT_LINK_RESOLVER
          default link resolver used if none provided
static java.lang.String DEFAULT_RESOURCE_PATH
          the default value for the resource path used to load classpath resources.
static java.lang.String RESOURCE_PATH_PROPERTY
          system property which can be used to set the path from which classpath resources are loaded (must end with a "/" if non-empty).
static java.lang.String TIMEZONE_PROPERTY
          system property which can be used to set the default TimeZone used for date calculations.
static java.lang.String USE_BIG_INDEX_PROPERTY
          (boolean) system property which can be used to disable the default big index support.
 
Constructor Summary
protected Database(java.io.File file, java.nio.channels.FileChannel channel, boolean autoSync, Database.FileFormat fileFormat, java.nio.charset.Charset charset, java.util.TimeZone timeZone, CodecProvider provider)
          Create a new database by reading it in from a FileChannel.
 
Method Summary
 void close()
          Close the database file (and any linked databases)
 java.lang.String copyTable(java.lang.String name, java.sql.ResultSet source)
          Copy an existing JDBC ResultSet into a new table in this database
 java.lang.String copyTable(java.lang.String name, java.sql.ResultSet source, ImportFilter filter)
          Copy an existing JDBC ResultSet into a new table in this database
static Database create(Database.FileFormat fileFormat, java.io.File mdbFile)
          Create a new Database for the given fileFormat Equivalent to: create(fileFormat, mdbFile, DEFAULT_AUTO_SYNC);
static Database create(Database.FileFormat fileFormat, java.io.File mdbFile, boolean autoSync)
          Create a new Database for the given fileFormat
static Database create(Database.FileFormat fileFormat, java.io.File mdbFile, boolean autoSync, java.nio.charset.Charset charset, java.util.TimeZone timeZone)
          Create a new Database for the given fileFormat
static Database create(java.io.File mdbFile)
          Create a new Access 2000 Database Equivalent to: create(FileFormat.V2000, mdbFile, DEFAULT_AUTO_SYNC);
static Database create(java.io.File mdbFile, boolean autoSync)
          Create a new Access 2000 Database Equivalent to: create(FileFormat.V2000, mdbFile, DEFAULT_AUTO_SYNC);
 void createLinkedTable(java.lang.String name, java.lang.String linkedDbName, java.lang.String linkedTableName)
          Create a new table in this database
 void createTable(java.lang.String name, java.util.List<Column> columns)
          Create a new table in this database
 void createTable(java.lang.String name, java.util.List<Column> columns, java.util.List<IndexBuilder> indexes)
          Create a new table in this database
 boolean defaultUseBigIndex()
          Returns false if "big index support" has been disabled explicity on the this Database or via a system property, true otherwise.
 boolean doUseBigIndex()
          Whether or not big index support is enabled for tables.
static java.lang.String escapeIdentifier(java.lang.String s)
           
 void flush()
          Flushes any current changes to the database file (and any linked databases) to disk.
 Table getAccessControlEntries()
           
 java.nio.charset.Charset getCharset()
          Gets currently configured Charset (always non-null).
 Table.ColumnOrder getColumnOrder()
          Gets currently configured Table.ColumnOrder (always non-null).
 java.lang.String getDatabasePassword()
           
 PropertyMap getDatabaseProperties()
           
static java.nio.charset.Charset getDefaultCharset(JetFormat format)
          Returns the default Charset for the given JetFormat.
 short getDefaultCodePage()
           
static Table.ColumnOrder getDefaultColumnOrder()
          Returns the default Table.ColumnOrder.
 Column.SortOrder getDefaultSortOrder()
           
static java.util.TimeZone getDefaultTimeZone()
          Returns the default TimeZone.
 ErrorHandler getErrorHandler()
          Gets the currently configured ErrorHandler (always non-null).
 java.io.File getFile()
          Returns the File underlying this Database
 Database.FileFormat getFileFormat()
          Returns the FileFormat of this database (which may involve inspecting the database itself).
 JetFormat getFormat()
           
 java.util.Map<java.lang.String,Database> getLinkedDatabases()
          Returns an unmodifiable view of the currently loaded linked databases, mapped from the linked database file name to the linked database.
 LinkResolver getLinkResolver()
          Gets the currently configured LinkResolver (always non-null).
 PageChannel getPageChannel()
           
 PropertyMaps getPropertiesForObject(int objectId)
           
 java.util.List<Query> getQueries()
          Finds all the queries in the database.
 java.util.List<Relationship> getRelationships(Table table1, Table table2)
          Finds all the relationships in the database between the given tables.
 PropertyMap getSummaryProperties()
           
 Table getSystemCatalog()
           
 Table getSystemComplexColumns()
           
 Table getSystemTable(java.lang.String tableName)
          Returns a reference to any available table in this access database, including system tables.
 java.util.Set<java.lang.String> getSystemTableNames()
           
 Table getTable(int tableDefPageNumber)
           
 Table getTable(java.lang.String name)
           
 Table getTable(java.lang.String name, boolean useBigIndex)
           
 java.util.Set<java.lang.String> getTableNames()
           
 java.util.TimeZone getTimeZone()
          Gets currently configured TimeZone (always non-null).
 PropertyMap getUserDefinedProperties()
           
 java.lang.String importFile(java.lang.String name, java.io.File f, java.lang.String delim)
          Copy a delimited text file into a new table in this database
 java.lang.String importFile(java.lang.String name, java.io.File f, java.lang.String delim, ImportFilter filter)
          Copy a delimited text file into a new table in this database
 java.lang.String importReader(java.lang.String name, java.io.BufferedReader in, java.lang.String delim)
          Copy a delimited text file into a new table in this database
 java.lang.String importReader(java.lang.String name, java.io.BufferedReader in, java.lang.String delim, ImportFilter filter)
          Copy a delimited text file into a new table in this database
static boolean isReservedWord(java.lang.String s)
           
 java.util.Iterator<Table> iterator()
           
static Database open(java.io.File mdbFile)
          Open an existing Database.
static Database open(java.io.File mdbFile, boolean readOnly)
          Open an existing Database.
static Database open(java.io.File mdbFile, boolean readOnly, boolean autoSync)
          Open an existing Database.
static Database open(java.io.File mdbFile, boolean readOnly, boolean autoSync, java.nio.charset.Charset charset, java.util.TimeZone timeZone)
          Open an existing Database.
static Database open(java.io.File mdbFile, boolean readOnly, boolean autoSync, java.nio.charset.Charset charset, java.util.TimeZone timeZone, CodecProvider provider)
          Open an existing Database.
 PropertyMaps readProperties(byte[] propsBytes, int objectId)
           
 void setCharset(java.nio.charset.Charset newCharset)
          Sets a new Charset.
 void setColumnOrder(Table.ColumnOrder newColumnOrder)
          Sets a new Table.ColumnOrder.
 void setErrorHandler(ErrorHandler newErrorHandler)
          Sets a new ErrorHandler.
 void setLinkResolver(LinkResolver newLinkResolver)
          Sets a new LinkResolver.
 void setTimeZone(java.util.TimeZone newTimeZone)
          Sets a new TimeZone.
 void setUseBigIndex(boolean useBigIndex)
          Set whether or not big index support is enabled for tables.
 java.lang.String toString()
           
static void validateIdentifierName(java.lang.String name, int maxLength, java.lang.String identifierType)
          Validates an identifier name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_AUTO_SYNC

public static final boolean DEFAULT_AUTO_SYNC
default value for the auto-sync value (true). this is slower, but leaves more chance of a useable database in the face of failures.

See Also:
Constant Field Values

DEFAULT_RESOURCE_PATH

public static final java.lang.String DEFAULT_RESOURCE_PATH
the default value for the resource path used to load classpath resources.

See Also:
Constant Field Values

DEFAULT_COLUMN_ORDER

public static final Table.ColumnOrder DEFAULT_COLUMN_ORDER
the default sort order for table columns.


USE_BIG_INDEX_PROPERTY

public static final java.lang.String USE_BIG_INDEX_PROPERTY
(boolean) system property which can be used to disable the default big index support.

See Also:
Constant Field Values

TIMEZONE_PROPERTY

public static final java.lang.String TIMEZONE_PROPERTY
system property which can be used to set the default TimeZone used for date calculations.

See Also:
Constant Field Values

CHARSET_PROPERTY_PREFIX

public static final java.lang.String CHARSET_PROPERTY_PREFIX
system property prefix which can be used to set the default Charset used for text data (full property includes the JetFormat version).

See Also:
Constant Field Values

RESOURCE_PATH_PROPERTY

public static final java.lang.String RESOURCE_PATH_PROPERTY
system property which can be used to set the path from which classpath resources are loaded (must end with a "/" if non-empty). Default value is DEFAULT_RESOURCE_PATH if unspecified.

See Also:
Constant Field Values

BROKEN_NIO_PROPERTY

public static final java.lang.String BROKEN_NIO_PROPERTY
(boolean) system property which can be used to indicate that the current vm has a poor nio implementation (specifically for FileChannel.transferFrom)

See Also:
Constant Field Values

COLUMN_ORDER_PROPERTY

public static final java.lang.String COLUMN_ORDER_PROPERTY
system property which can be used to set the default sort order for table columns. Value should be one Table.ColumnOrder enum values.

See Also:
Constant Field Values

DEFAULT_ERROR_HANDLER

public static final ErrorHandler DEFAULT_ERROR_HANDLER
default error handler used if none provided (just rethrows exception)


DEFAULT_LINK_RESOLVER

public static final LinkResolver DEFAULT_LINK_RESOLVER
default link resolver used if none provided

Constructor Detail

Database

protected Database(java.io.File file,
                   java.nio.channels.FileChannel channel,
                   boolean autoSync,
                   Database.FileFormat fileFormat,
                   java.nio.charset.Charset charset,
                   java.util.TimeZone timeZone,
                   CodecProvider provider)
            throws java.io.IOException
Create a new database by reading it in from a FileChannel.

Parameters:
file - the File to which the channel is connected
channel - 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.
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 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.
fileFormat - version of new database (if known)
charset - Charset to use, if null, uses default
timeZone - TimeZone to use, if null, uses default
Throws:
java.io.IOException
Method Detail

open

public static Database open(java.io.File mdbFile)
                     throws java.io.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.

Equivalent to: open(mdbFile, false);

Parameters:
mdbFile - File containing the database
Throws:
java.io.IOException
See Also:
open(File,boolean)

open

public static Database open(java.io.File mdbFile,
                            boolean readOnly)
                     throws java.io.IOException
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.

Equivalent to: open(mdbFile, readOnly, DEFAULT_AUTO_SYNC);

Parameters:
mdbFile - File containing the database
readOnly - iff true, force opening file in read-only mode
Throws:
java.io.IOException
See Also:
open(File,boolean,boolean)

open

public static Database open(java.io.File mdbFile,
                            boolean readOnly,
                            boolean autoSync)
                     throws java.io.IOException
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
readOnly - iff true, force opening file in read-only mode
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 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.
Throws:
java.io.IOException

open

public static Database open(java.io.File mdbFile,
                            boolean readOnly,
                            boolean autoSync,
                            java.nio.charset.Charset charset,
                            java.util.TimeZone timeZone)
                     throws java.io.IOException
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
readOnly - iff true, force opening file in read-only mode
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 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.
charset - Charset to use, if null, uses default
timeZone - TimeZone to use, if null, uses default
Throws:
java.io.IOException

open

public static Database open(java.io.File mdbFile,
                            boolean readOnly,
                            boolean autoSync,
                            java.nio.charset.Charset charset,
                            java.util.TimeZone timeZone,
                            CodecProvider provider)
                     throws java.io.IOException
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
readOnly - iff true, force opening file in read-only mode
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 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.
charset - Charset to use, if null, uses default
timeZone - TimeZone to use, if null, uses default
provider - CodecProvider for handling page encoding/decoding, may be null if no special encoding is necessary
Throws:
java.io.IOException

create

public static Database create(java.io.File mdbFile)
                       throws java.io.IOException
Create a new Access 2000 Database

Equivalent to: create(FileFormat.V2000, mdbFile, DEFAULT_AUTO_SYNC);

Parameters:
mdbFile - Location to write the new database to. If this file already exists, it will be overwritten.
Throws:
java.io.IOException
See Also:
create(File,boolean)

create

public static Database create(Database.FileFormat fileFormat,
                              java.io.File mdbFile)
                       throws java.io.IOException
Create a new Database for the given fileFormat

Equivalent to: create(fileFormat, mdbFile, DEFAULT_AUTO_SYNC);

Parameters:
fileFormat - version of new database.
mdbFile - Location to write the new database to. If this file already exists, it will be overwritten.
Throws:
java.io.IOException
See Also:
create(File,boolean)

create

public static Database create(java.io.File mdbFile,
                              boolean autoSync)
                       throws java.io.IOException
Create a new Access 2000 Database

Equivalent to: create(FileFormat.V2000, mdbFile, DEFAULT_AUTO_SYNC);

Parameters:
mdbFile - Location to write the new database to. If this file already exists, it will be overwritten.
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 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.
Throws:
java.io.IOException

create

public static Database create(Database.FileFormat fileFormat,
                              java.io.File mdbFile,
                              boolean autoSync)
                       throws java.io.IOException
Create a new Database for the given fileFormat

Parameters:
fileFormat - version of new database.
mdbFile - Location to write the new database to. If this file already exists, it will be overwritten.
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 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.
Throws:
java.io.IOException

create

public static Database create(Database.FileFormat fileFormat,
                              java.io.File mdbFile,
                              boolean autoSync,
                              java.nio.charset.Charset charset,
                              java.util.TimeZone timeZone)
                       throws java.io.IOException
Create a new Database for the given fileFormat

Parameters:
fileFormat - version of new database.
mdbFile - Location to write the new database to. If this file already exists, it will be overwritten.
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 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.
charset - Charset to use, if null, uses default
timeZone - TimeZone to use, if null, uses default
Throws:
java.io.IOException

getFile

public java.io.File getFile()
Returns the File underlying this Database


getPageChannel

public PageChannel getPageChannel()

getFormat

public JetFormat getFormat()

getSystemCatalog

public Table getSystemCatalog()
Returns:
The system catalog table

getAccessControlEntries

public Table getAccessControlEntries()
                              throws java.io.IOException
Returns:
The system Access Control Entries table (loaded on demand)
Throws:
java.io.IOException

getSystemComplexColumns

public Table getSystemComplexColumns()
                              throws java.io.IOException
Returns:
the complex column system table (loaded on demand)
Throws:
java.io.IOException

doUseBigIndex

public boolean doUseBigIndex()
Whether or not big index support is enabled for tables.


setUseBigIndex

public void setUseBigIndex(boolean useBigIndex)
Set whether or not big index support is enabled for tables.


getErrorHandler

public ErrorHandler getErrorHandler()
Gets the currently configured ErrorHandler (always non-null). This will be used to handle all errors unless overridden at the Table or Cursor level.


setErrorHandler

public void setErrorHandler(ErrorHandler newErrorHandler)
Sets a new ErrorHandler. If null, resets to the DEFAULT_ERROR_HANDLER.


getLinkResolver

public LinkResolver getLinkResolver()
Gets the currently configured LinkResolver (always non-null). This will be used to handle all linked database loading.


setLinkResolver

public void setLinkResolver(LinkResolver newLinkResolver)
Sets a new LinkResolver. If null, resets to the DEFAULT_LINK_RESOLVER.


getLinkedDatabases

public java.util.Map<java.lang.String,Database> getLinkedDatabases()
Returns an unmodifiable view of the currently loaded linked databases, mapped from the linked database file name to the linked database. This information may be useful for implementing a LinkResolver.


getTimeZone

public java.util.TimeZone getTimeZone()
Gets currently configured TimeZone (always non-null).


setTimeZone

public void setTimeZone(java.util.TimeZone newTimeZone)
Sets a new TimeZone. If null, resets to the value returned by getDefaultTimeZone().


getCharset

public java.nio.charset.Charset getCharset()
Gets currently configured Charset (always non-null).


setCharset

public void setCharset(java.nio.charset.Charset newCharset)
Sets a new Charset. If null, resets to the value returned by getDefaultCharset(com.healthmarketscience.jackcess.JetFormat).


getColumnOrder

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


setColumnOrder

public void setColumnOrder(Table.ColumnOrder newColumnOrder)
Sets a new Table.ColumnOrder. If null, resets to the value returned by getDefaultColumnOrder().


getFileFormat

public Database.FileFormat getFileFormat()
                                  throws java.io.IOException
Returns the FileFormat of this database (which may involve inspecting the database itself).

Throws:
java.lang.IllegalStateException - if the file format cannot be determined
java.io.IOException

getDefaultSortOrder

public Column.SortOrder getDefaultSortOrder()
                                     throws java.io.IOException
Returns:
the currently configured database default language sort order for textual columns
Throws:
java.io.IOException

getDefaultCodePage

public short getDefaultCodePage()
                         throws java.io.IOException
Returns:
the currently configured database default code page for textual data (may not be relevant to all database versions)
Throws:
java.io.IOException

readProperties

public PropertyMaps readProperties(byte[] propsBytes,
                                   int objectId)
                            throws java.io.IOException
Returns:
a PropertyMaps instance decoded from the given bytes (always returns non-null result).
Throws:
java.io.IOException

getTableNames

public java.util.Set<java.lang.String> getTableNames()
                                              throws java.io.IOException
Returns:
The names of all of the user tables (String)
Throws:
java.io.IOException

getSystemTableNames

public java.util.Set<java.lang.String> getSystemTableNames()
                                                    throws java.io.IOException
Returns:
The names of all of the system tables (String). Note, in order to read these tables, you must use getSystemTable(java.lang.String). Extreme care should be taken if modifying these tables directly!.
Throws:
java.io.IOException

iterator

public java.util.Iterator<Table> iterator()
Specified by:
iterator in interface java.lang.Iterable<Table>
Returns:
an unmodifiable Iterator of the user Tables in this Database.
Throws:
java.lang.IllegalStateException - if an IOException is thrown by one of the operations, the actual exception will be contained within
java.util.ConcurrentModificationException - if a table is added to the database while an Iterator is in use.

getTable

public Table getTable(java.lang.String name)
               throws java.io.IOException
Parameters:
name - Table name
Returns:
The table, or null if it doesn't exist
Throws:
java.io.IOException

getTable

public Table getTable(java.lang.String name,
                      boolean useBigIndex)
               throws java.io.IOException
Parameters:
name - Table name
useBigIndex - whether or not "big index support" should be enabled for the table (this value will override any other settings)
Returns:
The table, or null if it doesn't exist
Throws:
java.io.IOException

getTable

public Table getTable(int tableDefPageNumber)
               throws java.io.IOException
Parameters:
tableDefPageNumber - the page number of a table definition
Returns:
The table, or null if it doesn't exist
Throws:
java.io.IOException

createTable

public void createTable(java.lang.String name,
                        java.util.List<Column> columns)
                 throws java.io.IOException
Create a new table in this database

Parameters:
name - Name of the table to create
columns - List of Columns in the table
Throws:
java.io.IOException

createTable

public void createTable(java.lang.String name,
                        java.util.List<Column> columns,
                        java.util.List<IndexBuilder> indexes)
                 throws java.io.IOException
Create a new table in this database

Parameters:
name - Name of the table to create
columns - List of Columns in the table
indexes - List of IndexBuilders describing indexes for the table
Throws:
java.io.IOException

createLinkedTable

public void createLinkedTable(java.lang.String name,
                              java.lang.String linkedDbName,
                              java.lang.String linkedTableName)
                       throws java.io.IOException
Create a new table in this database

Parameters:
name - Name of the table to create
Throws:
java.io.IOException

getRelationships

public java.util.List<Relationship> getRelationships(Table table1,
                                                     Table table2)
                                              throws java.io.IOException
Finds all the relationships in the database between the given tables.

Throws:
java.io.IOException

getQueries

public java.util.List<Query> getQueries()
                                 throws java.io.IOException
Finds all the queries in the database.

Throws:
java.io.IOException

getSystemTable

public Table getSystemTable(java.lang.String tableName)
                     throws java.io.IOException
Returns a reference to any available table in this access database, including system tables.

Warning, this method is not designed for common use, only for the occassional time when access to a system table is necessary. Messing with system tables can strip the paint off your house and give your whole family a permanent, orange afro. You have been warned.

Parameters:
tableName - Table name, may be a system table
Returns:
The table, or null if it doesn't exist
Throws:
java.io.IOException

getDatabaseProperties

public PropertyMap getDatabaseProperties()
                                  throws java.io.IOException
Returns:
the core properties for the database
Throws:
java.io.IOException

getSummaryProperties

public PropertyMap getSummaryProperties()
                                 throws java.io.IOException
Returns:
the summary properties for the database
Throws:
java.io.IOException

getUserDefinedProperties

public PropertyMap getUserDefinedProperties()
                                     throws java.io.IOException
Returns:
the user-defined properties for the database
Throws:
java.io.IOException

getPropertiesForObject

public PropertyMaps getPropertiesForObject(int objectId)
                                    throws java.io.IOException
Returns:
the PropertyMaps for the object with the given id
Throws:
java.io.IOException

getDatabasePassword

public java.lang.String getDatabasePassword()
                                     throws java.io.IOException
Returns:
the current database password, or null if none set.
Throws:
java.io.IOException

copyTable

public java.lang.String copyTable(java.lang.String name,
                                  java.sql.ResultSet source)
                           throws java.sql.SQLException,
                                  java.io.IOException
Copy an existing JDBC ResultSet into a new table in this database

Parameters:
name - Name of the new table to create
source - ResultSet to copy from
Returns:
the name of the copied table
Throws:
java.sql.SQLException
java.io.IOException
See Also:
ImportUtil.importResultSet(ResultSet,Database,String)

copyTable

public java.lang.String copyTable(java.lang.String name,
                                  java.sql.ResultSet source,
                                  ImportFilter filter)
                           throws java.sql.SQLException,
                                  java.io.IOException
Copy an existing JDBC ResultSet into a new table in this database

Parameters:
name - Name of the new table to create
source - ResultSet to copy from
filter - valid import filter
Returns:
the name of the imported table
Throws:
java.sql.SQLException
java.io.IOException
See Also:
ImportUtil.importResultSet(ResultSet,Database,String,ImportFilter)

importFile

public java.lang.String importFile(java.lang.String name,
                                   java.io.File f,
                                   java.lang.String delim)
                            throws java.io.IOException
Copy a delimited text file into a new table in this database

Parameters:
name - Name of the new table to create
f - Source file to import
delim - Regular expression representing the delimiter string.
Returns:
the name of the imported table
Throws:
java.io.IOException
See Also:
ImportUtil.importFile(File,Database,String,String)

importFile

public java.lang.String importFile(java.lang.String name,
                                   java.io.File f,
                                   java.lang.String delim,
                                   ImportFilter filter)
                            throws java.io.IOException
Copy a delimited text file into a new table in this database

Parameters:
name - Name of the new table to create
f - Source file to import
delim - Regular expression representing the delimiter string.
filter - valid import filter
Returns:
the name of the imported table
Throws:
java.io.IOException
See Also:
ImportUtil.importFile(File,Database,String,String,ImportFilter)

importReader

public java.lang.String importReader(java.lang.String name,
                                     java.io.BufferedReader in,
                                     java.lang.String delim)
                              throws java.io.IOException
Copy a delimited text file into a new table in this database

Parameters:
name - Name of the new table to create
in - Source reader to import
delim - Regular expression representing the delimiter string.
Returns:
the name of the imported table
Throws:
java.io.IOException
See Also:
ImportUtil.importReader(BufferedReader,Database,String,String)

importReader

public java.lang.String importReader(java.lang.String name,
                                     java.io.BufferedReader in,
                                     java.lang.String delim,
                                     ImportFilter filter)
                              throws java.io.IOException
Copy a delimited text file into a new table in this database

Parameters:
name - Name of the new table to create
in - Source reader to import
delim - Regular expression representing the delimiter string.
filter - valid import filter
Returns:
the name of the imported table
Throws:
java.io.IOException
See Also:
ImportUtil.importReader(BufferedReader,Database,String,String,ImportFilter)

flush

public void flush()
           throws java.io.IOException
Flushes any current changes to the database file (and any linked databases) to disk.

Specified by:
flush in interface java.io.Flushable
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close the database file (and any linked databases)

Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException

escapeIdentifier

public static java.lang.String escapeIdentifier(java.lang.String s)
Returns:
A table or column name escaped for Access

isReservedWord

public static boolean isReservedWord(java.lang.String s)
Returns:
true if the given string is a reserved word, false otherwise

validateIdentifierName

public static void validateIdentifierName(java.lang.String name,
                                          int maxLength,
                                          java.lang.String identifierType)
Validates an identifier name.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

defaultUseBigIndex

public boolean defaultUseBigIndex()
Returns false if "big index support" has been disabled explicity on the this Database or via a system property, true otherwise.


getDefaultTimeZone

public static java.util.TimeZone getDefaultTimeZone()
Returns the default TimeZone. This is normally the platform default TimeZone as returned by TimeZone.getDefault(), but can be overridden using the system property "com.healthmarketscience.jackcess.timeZone".


getDefaultCharset

public static java.nio.charset.Charset getDefaultCharset(JetFormat format)
Returns the default Charset for the given JetFormat. This may or may not be platform specific, depending on the format, but can be overridden using a system property composed of the prefix "com.healthmarketscience.jackcess.charset." followed by the JetFormat version to which the charset should apply, e.g. "com.healthmarketscience.jackcess.charset.VERSION_3".


getDefaultColumnOrder

public static Table.ColumnOrder getDefaultColumnOrder()
Returns the default Table.ColumnOrder. This defaults to DEFAULT_COLUMN_ORDER, but can be overridden using the system property "com.healthmarketscience.jackcess.columnOrder".


Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013