|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanetj.database.DBSystem
Represents a relational database which can be referenced by a URL. A DBSystem object is created whenever the DatabaseManager opens a connection to a database. One DBSystem object exists for each alias used to create a connection pool
Field Summary | |
static byte |
LIBRARIES_NOT_SUPPORTED
This DB System does not support libraries |
static byte |
LIBRARIES_REQUIRED
This DB System requries libraries in SQL statements |
static byte |
LIBRARIES_SUPPORTED
This DB System supports libraries |
static java.lang.String |
METADATA_CATALOG_NAME_FIELD
|
static java.lang.String |
METADATA_COLUMN_NAME_FIELD
|
static int |
METADATA_COLUMN_NAME_OPERATION
|
static int |
METADATA_COLUMN_NAME_OPERATION_FOR_CATALOGS
|
static java.lang.String |
METADATA_LIBRARY_NAME
|
static java.lang.String |
METADATA_LIBRARY_NAME_FIELD
|
static java.lang.String |
METADATA_SYSTEM_NAME_FIELD
|
static java.lang.String |
METADATA_TABLE_NAME_FIELD
|
static java.lang.String |
METADATA_TABLE_NAME_FOR_COLUMNS
|
static java.lang.String |
METADATA_TABLE_NAME_FOR_LIBRARIES
|
static java.lang.String |
METADATA_TABLE_NAME_FOR_TABLES
|
static int |
METADATA_TABLE_NAME_OPERATION
|
static int |
METADATA_TABLE_NAME_OPERATION_FOR_CATALOGS
|
Constructor Summary | |
protected |
DBSystem()
Creates a new System object and sets its url and alias name. |
protected |
DBSystem(java.lang.String url)
Creates a new System object and sets its url and alias name. |
protected |
DBSystem(java.lang.String pURL,
java.lang.String pAlias)
Creates a new System object and sets its url and alias name. |
Method Summary | |
protected static void |
addSQLTypeName(java.lang.String name,
java.lang.Class c)
|
java.lang.Object |
correctDatabaseObject(java.lang.Object object,
int datatype)
Returns an object of the appropriate type for insertion into the database. |
void |
correctOperation(Operation op)
Corrects the operation to account for syntax differences of different DB systems. |
java.lang.String |
correctOperationSQL(java.lang.String originalSQL)
Deprecated. Use correctOperation(Operation) instead |
java.lang.String |
correctSQLLiteral(java.lang.String value)
Corrects the given SQL literal by adding additional escape characters to allow the value to be as is. |
Library |
createLibrary(java.lang.String pLibraryName)
Gets the Library with the given name. |
static DBSystem |
createSystem(java.lang.String systemURL)
Deprecated. removed (11/29/2002 1:48:58 PM) - driver is no required to create the DBSystem |
static DBSystem |
createSystem(java.lang.String url,
java.lang.String alias)
Creates and returns a new DBSystem using the given system url and alias |
static DBSystem |
createSystem(java.lang.String url,
java.lang.String alias,
java.lang.Class dbSystem)
Creates and returns a new DBSystem using the given system url and alias |
static DBSystem |
createSystem(java.lang.String url,
java.lang.String alias,
java.lang.String driver)
Creates and returns a new DBSystem using the given system url and alias |
java.lang.String |
getAlias()
Returns the alias of the system. |
java.util.Map |
getAllLibraries()
Returns a Map of all the Libraries (keyed by name) in this system. |
DataEngineCache |
getCache(AbstractContext context)
Gets the cache which holds RC's read from this system |
java.lang.String |
getColumnDataTypeName(FieldDescriptorRow oldFD)
Gets the correct column data type name for the FD on this system. |
java.lang.String |
getColumnIndicationCharacter()
Returns the character that needs to be used during an insert. |
java.lang.String |
getColumnPrimaryKeyName(FieldDescriptorRow oldFD)
Gets the correct column name which a primary key on this system should refer to for the FD. |
int |
getDataType(IParameter param)
Gets the correct data type for the parameter for this DBSystem. |
java.lang.String |
getDBLibraryName(Library library)
Returns the database name of the given library in the database. |
java.lang.String |
getDefaultDateFormat()
|
java.lang.String |
getDefaultLibraryName()
Gets the name of the default library specified in the connection URL. |
java.lang.String |
getDefaultTimeFormat()
|
java.lang.String |
getDefaultTimestampFormat()
|
static java.lang.Class |
getFieldClassForSQLTypeName(java.lang.String pTypeName)
Gets the Field subclass that is representative of this SQL type name. |
byte[] |
getIPAddress()
Gets the IP Address of this system |
java.util.Map |
getLibraries()
Gets a Map of the libraries in this system. |
Library |
getLibrary(java.lang.String pLibraryName)
Gets one of this system's libraries |
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. |
java.lang.String |
getLibraryTableSeparator()
Get the separator that should be placed between a library and a table for the system. |
java.lang.String |
getMetaDataAlias()
Gets the alias of the system containing additional meta data (FD's, PV's, etc) for this system. |
java.sql.ResultSet |
getMetadataColumns(SQLContext context)
Return a ResultSet of Columns |
java.sql.ResultSet |
getMetadataLibraries(SQLContext context)
Return a ResultSet of libraries (schemas) |
static DBSystem |
getMetaDataSystem()
Gets the metadata system |
java.sql.ResultSet |
getMetadataTables(SQLContext context)
Return a ResultSet of Tables |
java.lang.String |
getName()
|
java.lang.String |
getProperties()
Gets the connection JDBC properties of the system. |
static java.util.List |
getSQLTypeNames()
Gets a List of SQL type names. |
int |
getSupportedDataType(int datatype)
Returns the equivalent supported datatype name for a specified datatype. |
static DBSystem |
getSystem(java.lang.String systemAlias)
Gets the DBSystem for the given system alias. |
java.lang.String |
getURL()
Returns the url of the system. |
java.lang.StringBuffer |
getXMLData(java.lang.StringBuffer pXMLData)
This returns a StringBuffer containing all necessary XML data for this object. |
void |
handleConnectionEvent(ConnectionEvent event)
Invoked when a ConnectionEvent occurs. |
boolean |
isAS400()
Returns whether or not this DBSystem is an AS400 DB system KGetting (07/13/2005) |
boolean |
isBackgroundThreadsSupported()
Override this method to return false if this system does not support background threads |
boolean |
isDB2()
Returns whether or not this DBSystem is a DB2 DB system KGetting (07/13/2005) |
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). |
boolean |
isDelegateToPersonal()
Tests if this DBSystem is a placeholder for multiple personal DBSystems which should be used to connect to the DB in lieu of using this one. |
boolean |
isHasAllLibraries()
Returns whether or not this DBSystem has all the libraries in the database. |
boolean |
isMSAccess()
Returns whether or not this DBSystem is an MS Access DB system KGetting (07/13/2005) |
boolean |
isMySQL()
Returns whether or not this DBSystem is a MySQL DB system KGetting (07/13/2005) |
boolean |
isOracle()
Returns whether or not this DBSystem is an Oracle DB system KGetting (07/13/2005) |
boolean |
isSQLServer()
Returns whether or not this DBSystem is a MS SQL Server DB system KGetting (07/13/2005) |
Library |
removeLibrary(java.lang.String pLibraryName)
Removes the Library with the given name. |
protected void |
setAlias(java.lang.String pAlias)
Sets the url of the system. |
void |
setDelegateToPersonal(boolean newDelegateToPersonal)
Sets if this DBSystem is a placeholder for multiple personal DBSystems which should be used to connect to the DB in lieu of using this one. |
protected void |
setMetaDataAlias(java.lang.String pMetaDataAlias)
Sets the alias of the system containing additional meta data (FD's, PV's, etc) for this system. |
void |
setProperties(java.lang.String pProperties)
Sets the connection JDBC properties of the system. |
protected void |
setURL(java.lang.String pURL)
Sets the url of the system. |
protected void |
setURLInternal(java.lang.String pURL)
Sets the url of the system. |
void |
startRetrieveAllLibrariesTask()
Starts a task to retrieve all the Libraries in the database for this system. |
void |
taskCompleted(TaskEvent pTaskEvent)
Invoked when a task completes its execution. |
void |
taskFailed(TaskEvent pTaskEvent)
Invoked when a task fails while executing. |
void |
taskStarted(TaskEvent pTaskEvent)
Invoked when a task starts executing. |
java.lang.String |
toString()
Returns the String representation of this system. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte LIBRARIES_NOT_SUPPORTED
public static final byte LIBRARIES_SUPPORTED
public static final byte LIBRARIES_REQUIRED
public static final java.lang.String METADATA_COLUMN_NAME_FIELD
public static final java.lang.String METADATA_TABLE_NAME_FIELD
public static final java.lang.String METADATA_LIBRARY_NAME_FIELD
public static final java.lang.String METADATA_CATALOG_NAME_FIELD
public static final java.lang.String METADATA_SYSTEM_NAME_FIELD
public static final java.lang.String METADATA_LIBRARY_NAME
public static final java.lang.String METADATA_TABLE_NAME_FOR_LIBRARIES
public static final java.lang.String METADATA_TABLE_NAME_FOR_TABLES
public static final java.lang.String METADATA_TABLE_NAME_FOR_COLUMNS
public static final int METADATA_TABLE_NAME_OPERATION
public static final int METADATA_COLUMN_NAME_OPERATION
public static final int METADATA_TABLE_NAME_OPERATION_FOR_CATALOGS
public static final int METADATA_COLUMN_NAME_OPERATION_FOR_CATALOGS
Constructor Detail |
protected DBSystem()
protected DBSystem(java.lang.String url)
url
- Stringprotected DBSystem(java.lang.String pURL, java.lang.String pAlias)
Method Detail |
protected static void addSQLTypeName(java.lang.String name, java.lang.Class c)
public java.lang.Object correctDatabaseObject(java.lang.Object object, int datatype)
object
- The object to be inserted into the databasedatatype
- The datatype of the database field
public java.lang.String correctSQLLiteral(java.lang.String value)
public void correctOperation(Operation op)
public java.lang.String correctOperationSQL(java.lang.String originalSQL)
public Library createLibrary(java.lang.String pLibraryName)
pLibraryName
- name of Library
public static DBSystem createSystem(java.lang.String systemURL) throws DataEngineException
systemURL
- String
DataEngineException
public static DBSystem createSystem(java.lang.String url, java.lang.String alias) throws DataEngineException
DataEngineException
public static DBSystem createSystem(java.lang.String url, java.lang.String alias, java.lang.Class dbSystem) throws DataEngineException
url
- String
DataEngineException
public static DBSystem createSystem(java.lang.String url, java.lang.String alias, java.lang.String driver) throws DataEngineException
DataEngineException
public java.lang.String getAlias()
public java.util.Map getAllLibraries() throws DataEngineException
DataEngineException
public DataEngineCache getCache(AbstractContext context)
public java.lang.String getColumnDataTypeName(FieldDescriptorRow oldFD)
oldFD
- The FD for the column of the existing tablepublic java.lang.String getColumnIndicationCharacter()
This char will is necessary when a column name is the same as a reserved keyword for this DBSystem. Such as KEY or USER Creation date: (6/23/2003 2:27:41 PM)
public java.lang.String getColumnPrimaryKeyName(FieldDescriptorRow oldFD)
oldFD
- The FD for the column of the existing tablepublic int getDataType(IParameter param)
public java.lang.String getDBLibraryName(Library library)
public java.lang.String getDefaultDateFormat()
public java.lang.String getDefaultTimeFormat()
public java.lang.String getDefaultTimestampFormat()
public java.lang.String getDefaultLibraryName()
public static java.lang.Class getFieldClassForSQLTypeName(java.lang.String pTypeName) throws DataEngineException
pTypeName
- The SQL type name of the field
DataEngineException
public byte[] getIPAddress()
public java.util.Map getLibraries()
public java.sql.ResultSet getMetadataColumns(SQLContext context) throws CMException
CMException
public java.sql.ResultSet getMetadataTables(SQLContext context) throws CMException
CMException
public java.sql.ResultSet getMetadataLibraries(SQLContext context) throws CMException
CMException
public Library getLibrary(java.lang.String pLibraryName)
pLibraryName
- The name of the library to get
public Library getLibrary(java.lang.String pLibraryName, boolean pCreate)
pLibraryName
- The name of the library to getpCreate
- Whether or not the library should be created if it doesn't exist
public byte getLibrarySupportLevel()
public java.lang.String getLibraryTableSeparator()
public java.lang.String getMetaDataAlias()
public static DBSystem getMetaDataSystem()
public java.lang.String getName()
getName
in interface IDBObject
public java.lang.String getProperties()
public static java.util.List getSQLTypeNames()
public int getSupportedDataType(int datatype)
If the supplied datatype is supported, then that same datatype is returned.
public static DBSystem getSystem(java.lang.String systemAlias)
public java.lang.String getURL()
public java.lang.StringBuffer getXMLData(java.lang.StringBuffer pXMLData)
getXMLData
in interface IXMLObject
public void handleConnectionEvent(ConnectionEvent event)
public boolean isBackgroundThreadsSupported()
public boolean isDefaultLibraryOmitted()
public boolean isDelegateToPersonal()
public boolean isHasAllLibraries()
public boolean isMySQL()
public boolean isSQLServer()
public boolean isOracle()
public boolean isMSAccess()
public boolean isDB2()
public boolean isAS400()
public Library removeLibrary(java.lang.String pLibraryName)
pLibraryName
- name of Library
protected void setAlias(java.lang.String pAlias)
public void setDelegateToPersonal(boolean newDelegateToPersonal)
protected void setMetaDataAlias(java.lang.String pMetaDataAlias)
pMetaDataAlias
- alias of system containing meta datapublic void setProperties(java.lang.String pProperties)
protected void setURL(java.lang.String pURL)
protected void setURLInternal(java.lang.String pURL)
public void startRetrieveAllLibrariesTask()
public void taskCompleted(TaskEvent pTaskEvent)
taskCompleted
in interface ITaskListener
public void taskFailed(TaskEvent pTaskEvent)
taskFailed
in interface ITaskListener
public void taskStarted(TaskEvent pTaskEvent)
taskStarted
in interface ITaskListener
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |