planetj.database
Class MSAccessDBSystem

java.lang.Object
  |
  +--planetj.database.DBSystem
        |
        +--planetj.database.MSAccessDBSystem
All Implemented Interfaces:
EventListener, IDBObject, ITaskListener, IXMLObject, Serializable

public class MSAccessDBSystem
extends DBSystem

Represents a Microsoft Access database

See Also:
Serialized Form

Field Summary
static String ODBC_DRIVER
           
 
Fields inherited from class planetj.database.DBSystem
LIBRARIES_NOT_SUPPORTED, LIBRARIES_REQUIRED, LIBRARIES_SUPPORTED
 
Method Summary
 Object correctDatabaseObject(Object object, int datatype)
          Returns an object of the appropriate type for insertion into the database.
 Library createLibrary(String pLibraryName)
          Gets the Library with the given name.
static void export(RowCollection rc, MSAccessDescriptor descriptor)
          Writes out the RowCollection to an MS Access file
 Library getLibrary(String pLibraryName, boolean pCreate)
          Get the DBSystem's Library with the given name.
 byte getLibrarySupportLevel()
          Gets the level of library support; this is one of the constants defined in the class.
 int getSupportedDataType(int datatype)
          Returns the equivalent supported datatype for a specified datatype.
 boolean isBackgroundThreadsSupported()
          Override this method to return false if this system does not support background threads
 boolean isDefaultLibraryOmitted()
          Tests if the default library should be included in SQL statements sent to the DB (if the statement operates on the default library).
 
Methods inherited from class planetj.database.DBSystem
createSystem, createSystem, createSystem, createSystem, getAlias, getAllLibraries, getCache, getColumnIndicationCharacter, getDefaultDateFormat, getDefaultLibraryName, getFieldClassForSQLTypeName, getIPAddress, getLibraries, getLibrary, getMetaDataAlias, getMetaDataSystem, getName, getProperties, getSQLTypeNames, getSystem, getURL, getXMLData, isDelegateToPersonal, isHasAllLibraries, removeLibrary, setDelegateToPersonal, setProperties, startRetrieveAllLibrariesTask, taskCompleted, taskFailed, taskStarted, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ODBC_DRIVER

public static final String ODBC_DRIVER
See Also:
Constant Field Values
Method Detail

correctDatabaseObject

public Object correctDatabaseObject(Object object,
                                    int datatype)
Returns an object of the appropriate type for insertion into the database. In some cases, the default object type for a given datatype may not be appropriate for a given DB system - this method addresses that issue

Overrides:
correctDatabaseObject in class DBSystem
Parameters:
object - The object to be inserted into the database
datatype - The datatype of the database field
Returns:
The corrected object to be inserted into the database

createLibrary

public Library createLibrary(String pLibraryName)
Gets the Library with the given name. The library is created if it does not exist.

Overrides:
createLibrary in class DBSystem
Parameters:
pLibraryName - name of Library
Returns:
newly created or existing Library

export

public static void export(RowCollection rc,
                          MSAccessDescriptor descriptor)
                   throws CMException
Writes out the RowCollection to an MS Access file

CMException

getLibrary

public Library getLibrary(String pLibraryName,
                          boolean pCreate)
Get the DBSystem's Library with the given name. If it does not exist and specified so, then the Library is created.

Overrides:
getLibrary in class DBSystem
Parameters:
pLibraryName - The name of the library to get
pCreate - Whether or not the library should be created if it doesn't exist
Returns:
Library with specified name or null if it does not exist and create was not specified

getLibrarySupportLevel

public byte getLibrarySupportLevel()
Gets the level of library support; this is one of the constants defined in the class. By default, libraries are required. Subclasses may override this method to indicate a different level of library support.

Overrides:
getLibrarySupportLevel in class DBSystem

getSupportedDataType

public int getSupportedDataType(int datatype)
Returns the equivalent supported datatype for a specified datatype. For example, MS Access does not support the NUMERIC datatype, so if Types.NUMERIC was passed into this method on an Access system, the Types.NUMERIC datatype would be returned (since that is the datatype which will be used to store NUMERIC values on Access systems).

If the supplied datatype is supported, then that same datatype is returned.

Overrides:
getSupportedDataType in class DBSystem

isBackgroundThreadsSupported

public boolean isBackgroundThreadsSupported()
Override this method to return false if this system does not support background threads

Overrides:
isBackgroundThreadsSupported in class DBSystem

isDefaultLibraryOmitted

public boolean isDefaultLibraryOmitted()
Tests if the default library should be included in SQL statements sent to the DB (if the statement operates on the default library). For example, if the we want to select all records in MYTABLE in the default libarary (which is MYLIB):

When this method returns true: SELECT * FROM MYTABLE
When this method returns false: SELECT * FROM MYLIB.MYTABLE

Overrides:
isDefaultLibraryOmitted in class DBSystem