planetj.database
Class MSAccessDBSystem
java.lang.Object
planetj.database.DBSystem
planetj.database.MSAccessDBSystem
- All Implemented Interfaces:
- java.util.EventListener, IDBObject, ITaskListener, IXMLObject, java.io.Serializable
- public class MSAccessDBSystem
- extends DBSystem
Represents a Microsoft Access database
- See Also:
- Serialized Form
Fields inherited from class planetj.database.DBSystem |
LIBRARIES_NOT_SUPPORTED, LIBRARIES_REQUIRED, LIBRARIES_SUPPORTED, METADATA_CATALOG_NAME_FIELD, METADATA_COLUMN_NAME_FIELD, METADATA_COLUMN_NAME_OPERATION, METADATA_COLUMN_NAME_OPERATION_FOR_CATALOGS, METADATA_LIBRARY_NAME, METADATA_LIBRARY_NAME_FIELD, METADATA_SYSTEM_NAME_FIELD, METADATA_TABLE_NAME_FIELD, METADATA_TABLE_NAME_FOR_COLUMNS, METADATA_TABLE_NAME_FOR_LIBRARIES, METADATA_TABLE_NAME_FOR_TABLES, METADATA_TABLE_NAME_OPERATION, METADATA_TABLE_NAME_OPERATION_FOR_CATALOGS |
Method Summary |
java.lang.Object |
correctDatabaseObject(java.lang.Object object,
int datatype)
Returns an object of the appropriate type for insertion into the database. |
Library |
createLibrary(java.lang.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 |
java.lang.String |
getDBLibraryName(Library library)
Returns the database name of the given library in the database. |
Library |
getLibrary(java.lang.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 |
correctOperation, correctOperationSQL, correctSQLLiteral, createSystem, createSystem, createSystem, createSystem, getAlias, getAllLibraries, getCache, getColumnDataTypeName, getColumnIndicationCharacter, getColumnPrimaryKeyName, getDataType, getDefaultDateFormat, getDefaultLibraryName, getDefaultTimeFormat, getDefaultTimestampFormat, getFieldClassForSQLTypeName, getIPAddress, getLibraries, getLibrary, getLibraryTableSeparator, getMetaDataAlias, getMetadataColumns, getMetadataLibraries, getMetaDataSystem, getMetadataTables, getName, getProperties, getSQLTypeNames, getSystem, getURL, getXMLData, handleConnectionEvent, isAS400, isDB2, isDelegateToPersonal, isHasAllLibraries, isMSAccess, isMySQL, isOracle, isSQLServer, removeLibrary, setDelegateToPersonal, setProperties, startRetrieveAllLibrariesTask, taskCompleted, taskFailed, taskStarted, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ODBC_DRIVER
public static final java.lang.String ODBC_DRIVER
- See Also:
- Constant Field Values
correctDatabaseObject
public java.lang.Object correctDatabaseObject(java.lang.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 databasedatatype
- The datatype of the database field
- Returns:
- The corrected object to be inserted into the database
createLibrary
public Library createLibrary(java.lang.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
getDBLibraryName
public java.lang.String getDBLibraryName(Library library)
- Returns the database name of the given library in the database.
- Overrides:
getDBLibraryName
in class DBSystem
export
public static void export(RowCollection rc,
MSAccessDescriptor descriptor)
throws CMException
- Writes out the RowCollection to an MS Access file
- Throws:
CMException
getLibrary
public Library getLibrary(java.lang.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 getpCreate
- 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