|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectoracle.javatools.db.AbstractDBObjectProvider
oracle.javatools.db.AbstractDatabase
Base implementation of the Database interface.
AbstractDatabase can be subclassed to provide support for specific
types of databases.
JdbcDatabase,
BaseOracleDatabase| Field Summary | |
static java.lang.String |
SQLSTATE_NOT_IMPLEMENTED
|
| Fields inherited from class oracle.javatools.db.AbstractDBObjectProvider |
EMPTY_LIST, LOWER_CASE_NAME_POLICY, MIXED_CASE_NAME_POLICY, TIMESTAMP_PROPERTY, UPPER_CASE_NAME_POLICY |
| Fields inherited from interface oracle.javatools.db.Database |
FOUR_GIG, GENERIC_JDBC_DATABASE, SOURCE_TYPE_BODY, SOURCE_TYPE_SPEC, TWO_GIG |
| Fields inherited from interface oracle.javatools.db.DBObjectProvider |
CREATE_PRIVILEDGE, DELETE_PRIVILEDGE, MODIFY_PRIVILEDGE |
| Constructor Summary | |
protected |
AbstractDatabase(java.lang.String connName,
java.sql.Connection conn)
Constructs a new AbstractDatabase. |
| Method Summary | |
void |
close()
Closes the Database Connection (and the supplied JDBC Connection). |
void |
createObjects(SchemaObject[] objects,
boolean replace)
Default implementation of this method simply iterates through the objects calling createObject on each. |
protected Schema |
createSchema(java.lang.String name)
|
void |
deleteObjects(SchemaObject[] objects,
boolean cascade)
Default implementation of this method simply iterates through the objects calling createObject on each. |
protected boolean |
exists(SchemaObject obj)
Whether the specified object exists. |
boolean |
exists(java.lang.String type,
java.lang.String schema,
java.lang.String name)
Checks for existance of a schema object named objectName. |
protected void |
finishCreate(SchemaObject[] objects,
SchemaObject[] oldObjects)
Use to finish the create or update of objects after the changes have been made in the db. |
protected void |
finishDelete(Schema schema,
SchemaObject[] objs)
Use to finish the delete of the given objects after the operation has been performed against the db. |
java.sql.Connection |
getConnection()
Gets the JDBC connection associated with this database. |
java.lang.String |
getConnectionName()
Retrieves the ConnectionManager name for the Connection associated with this Database. |
java.lang.String |
getDatabaseSource(java.lang.String objectType,
Schema schema,
java.lang.String objectName)
Retrieves the source for an object in the database. |
java.lang.String |
getDatabaseSource(java.lang.String objectType,
Schema schema,
java.lang.String objectName,
java.lang.String sourceType)
Retrieves the source for an object in the database. |
protected DDLGenerator |
getDDLGenerator()
Retrieves the DDLGenerator used by default. |
Schema |
getDefaultSchema()
Returns the default schema for the provider. |
java.lang.String |
getName()
Returns an identifier for this provider. |
protected SchemaObject |
getObjectImpl(java.lang.String objectType,
Schema schema,
java.lang.String name)
|
java.lang.Long |
getTimestamp(java.lang.String objectName,
Schema schema,
java.lang.String type)
Retrieves the timestamp representing the last modification time of the specified object's metadata. |
boolean |
isObjectValid(java.lang.String objectType,
java.lang.String schema,
java.lang.String objectName)
Determines whether the specified database object is in a valid state. |
protected abstract void |
registerBuilders()
Called to request that the DBOBjectBuilders be registered. |
protected void |
registerValidators()
By default this registers default validators for Schema, Sequences, Synonyms, Indexes, Constraints and Columns for the wizards to use. |
protected void |
setDDLGenerator(DDLGenerator gen)
Sets the DDLGenerator used by default. |
protected void |
sqlTrace(java.lang.String query)
Tracing method to print out SQL that is about to be executed against the db. |
protected void |
sqlTrace(java.lang.String query,
java.lang.Object[] params)
Tracing method to print out SQL that is about to be executed against the db. |
boolean |
supportsDebugging()
Whether this database instance supports JDWP debugging. |
void |
updateObjects(SchemaObject[] oldObjects,
SchemaObject[] newObjects)
Default implementation of this method simply iterates through the objects calling createObject on each. |
protected static void |
validateIdentifier(java.lang.String name,
char quoter,
int maxLength,
java.lang.String allowedChars,
boolean alphaStart,
java.util.Set reservedWords,
int casePolicy)
Checks that the given identifier is correctly quoted and does not exceed the given max length (taking quotes into account). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface oracle.javatools.db.Database |
getDatabaseType, getIdentifierQuoteString, getUserName |
| Methods inherited from interface oracle.javatools.db.DBObjectProvider |
addProviderListener, canCreate, canCreate, canDelete, canDelete, createObject, createSchema, deleteObject, deleteSchema, getDataType, getExternalName, getExternalName, getInternalName, getInternalName, getObject, getSchema, getUniqueName, hasPriviledge, isValidName, listObjects, listObjects, listObjects, listObjects, listObjectTypes, listSchemas, listSupportedDataTypes, quoteIdentifier, removeProviderListener, updateObject, updateSchema, validateName, validateObject, validateObject, validateObject, validateObject, validateSchema, validateSchema, validateUniqueName |
| Field Detail |
public static final java.lang.String SQLSTATE_NOT_IMPLEMENTED
| Constructor Detail |
protected AbstractDatabase(java.lang.String connName,
java.sql.Connection conn)
connName - a String containing the ConnectionManager name for the
connection associated with this Databaseconn - the Connection used by this AbstractDatabase| Method Detail |
protected void sqlTrace(java.lang.String query)
protected void sqlTrace(java.lang.String query,
java.lang.Object[] params)
protected void registerValidators()
protected void setDDLGenerator(DDLGenerator gen)
gen - The DDLGenerator to use for generating DDLprotected DDLGenerator getDDLGenerator()
protected boolean exists(SchemaObject obj)
obj - The object being checked
protected abstract void registerBuilders()
public java.sql.Connection getConnection()
Database
getConnection in interface Databasepublic java.lang.String getName()
AbstractDBObjectProvider
getName in class AbstractDBObjectProviderpublic java.lang.String getConnectionName()
Database
getConnectionName in interface Databasepublic void close()
Database
close in interface Database
public boolean exists(java.lang.String type,
java.lang.String schema,
java.lang.String name)
DatabaseobjectName.
exists in interface Databasename - The name of the schema object.
true if the object exists, false
otherwise.
public boolean isObjectValid(java.lang.String objectType,
java.lang.String schema,
java.lang.String objectName)
Database
isObjectValid in interface Databaseschema - the name of the schema containing the objectobjectName - the name of the objectobjectType - the type of the object.protected final Schema createSchema(java.lang.String name)
protected void finishCreate(SchemaObject[] objects,
SchemaObject[] oldObjects)
throws DBException
DBException
protected void finishDelete(Schema schema,
SchemaObject[] objs)
public void createObjects(SchemaObject[] objects,
boolean replace)
throws DBException
createObjects in interface DBObjectProvidercreateObjects in class AbstractDBObjectProviderDBException
public void deleteObjects(SchemaObject[] objects,
boolean cascade)
throws DBException
deleteObjects in interface DBObjectProviderdeleteObjects in class AbstractDBObjectProviderDBException
public void updateObjects(SchemaObject[] oldObjects,
SchemaObject[] newObjects)
throws DBException
updateObjects in interface DBObjectProviderupdateObjects in class AbstractDBObjectProviderDBException
public java.lang.String getDatabaseSource(java.lang.String objectType,
Schema schema,
java.lang.String objectName)
throws DBException
Databasenull.
getDatabaseSource in interface DatabaseobjectType - The type of object for which the source is neededschema - The Schema containing the objectobjectName - The name of the object
DBException - if an error occurs fetching the source
public java.lang.String getDatabaseSource(java.lang.String objectType,
Schema schema,
java.lang.String objectName,
java.lang.String sourceType)
throws DBException
Databasenull. This method combines spec and
body for those source types that support both.
getDatabaseSource in interface DatabaseobjectType - The type of object for which the source is neededschema - The Schema containing the objectobjectName - The name of the objectsourceType - In the case of types that have more than one source,
the type of source required. Can be Database.SOURCE_TYPE_SPEC or
Database.SOURCE_TYPE_BODY. If null, the default of body is selected.
DBException - if an error occurs fetching the source
public Schema getDefaultSchema()
throws DBException
DBObjectProvider
getDefaultSchema in interface DBObjectProviderDBException
public java.lang.Long getTimestamp(java.lang.String objectName,
Schema schema,
java.lang.String type)
DBObjectProvidernull value should be returned.
getTimestamp in interface DBObjectProviderobjectName - a String containing the type of the objectschema - the Schema containing the objecttype - a String containing the name of the object
public boolean supportsDebugging()
Databasefalse.
supportsDebugging in interface Databasetrue if JDWP debugging is supported against this
database, false otherwise
protected static void validateIdentifier(java.lang.String name,
char quoter,
int maxLength,
java.lang.String allowedChars,
boolean alphaStart,
java.util.Set reservedWords,
int casePolicy)
throws InvalidNameException
name - the identifier to checkquoter - the quote string (e.g. " )maxLength - the maximum length a name can be (not including quotes)allowedChars - characters that are allowed in the name (other than
alphanumericalphaStart - whether to enforce that the string must start with an
alphabet character.reservedWords - Set of words that are reserved in the databasecasePolicy - the case policy to use
InvalidNameException - with an appropraite message if the identifier
isn't valid.
protected SchemaObject getObjectImpl(java.lang.String objectType,
Schema schema,
java.lang.String name)
throws DBException
getObjectImpl in class AbstractDBObjectProviderDBException
|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Copyright © 1997, 2005, Oracle.All rights reserved.