Extension SDK 9.0.5

oracle.jdeveloper.cm.ds.db
Class JdbcDatabase

java.lang.Object
  extended byoracle.jdeveloper.cm.ds.db.AbstractDBObjectProvider
      extended byoracle.jdeveloper.cm.ds.db.AbstractDatabase
          extended byoracle.jdeveloper.cm.ds.db.JdbcDatabase
All Implemented Interfaces:
Database, DBObjectProvider, Observer

public class JdbcDatabase
extends AbstractDatabase

Implementation of the Database interface for JDBC Databases. The JdbcDatabase class provides support for generic JDBC databases; it can be subclasses to provide support for specific vendors and/or versions.

Since:
9.0.5

Field Summary
static DataType ANSI_CHARACTER
           
static DataType ANSI_CHARACTER_VARYING
           
static DataType ANSI_DATE
           
static DataType ANSI_DECIMAL
           
static DataType ANSI_DOUBLE_PRECISION
           
static DataType ANSI_FLOAT
           
static DataType ANSI_INT
           
static DataType ANSI_INTEGER
           
static DataType ANSI_NUMERIC
           
static DataType ANSI_REAL
           
static DataType ANSI_SMALLINT
           
static DataType ANSI_TIME
           
static java.lang.String ODBC_NOT_IMPLEMENTED
           
 
Fields inherited from class oracle.jdeveloper.cm.ds.db.AbstractDatabase
SQLSTATE_NOT_IMPLEMENTED
 
Fields inherited from class oracle.jdeveloper.cm.ds.db.AbstractDBObjectProvider
EMPTY_LIST, LOWER_CASE_NAME_POLICY, MIXED_CASE_NAME_POLICY, TIMESTAMP_PROPERTY, UPPER_CASE_NAME_POLICY
 
Fields inherited from interface oracle.jdeveloper.cm.ds.db.Database
GENERIC_JDBC_DATABASE
 
Fields inherited from interface oracle.jdeveloper.cm.ds.db.DBObjectProvider
CREATE_PRIVILEDGE, DELETE_PRIVILEDGE, MODIFY_PRIVILEDGE
 
Constructor Summary
JdbcDatabase(java.sql.Connection conn)
           
JdbcDatabase(java.lang.String connName, java.sql.Connection conn)
          Constructs a new JdbcDatabase.
 
Method Summary
 boolean canCreate(Schema schema, boolean replace)
          Whether an attempt to create the specified schema is likely to succeed.
 boolean canCreate(SchemaObject object, boolean replace)
          Whether an attempt to create the specified object is likely to succeed.
 boolean canDelete(Schema schema, boolean cascade)
          Checks to see whether a specific schema can be deleted.
 boolean canDelete(SchemaObject object, boolean cascade)
          Checks to see whether a specific object can be deleted.
 void createObject(SchemaObject object, boolean replace)
          Causes the creation of the object described by the specified meta data.
 void createSchema(Schema schema, boolean replace)
          Causes the creation of a new Schema in the persistent storage.
 void deleteObject(SchemaObject object, boolean cascade)
          Deletes the object.
 void deleteSchema(Schema schema, boolean cascade)
          Deletes the schema.
protected  int getCasePolicy()
          Retrieves the case policy in effect for this Database.
 java.lang.String getDatabaseType()
          Gets the type of database.
 java.lang.String getIdentifierQuoteString()
          Returns the String to use to quote SQL identifiers with
 Schema getSchema(java.lang.String name)
          Retrieves the Schema object associated with a specific name.
 long getTimestamp(java.lang.String schema, java.lang.String type, java.lang.String objectName)
          Gets the timestamp of a PL/SQL Subprogram
 java.lang.String getUniqueName(java.lang.String type, Schema schema, java.lang.String base)
          Retrieves a unique name for an object of a specific type.
 java.lang.String getUserName()
          Retrieves the username used to connect to the database
 boolean hasPriviledge(java.lang.String type, Schema schema, java.lang.String priv)
          Checks to see whether the user has the requisite permissions to perform the specified operation.
 Schema[] listSchemas()
          Retrieves the list of schemas available from this provider.
protected  void registerBuilders()
          Called to request that the DBOBjectBuilders be registered.
protected  void registerDataTypes()
          Called to request that the datatypes be registered.
 boolean supportsDebugging()
          Whether this database instance supports JDWP debugging.
 void updateObject(SchemaObject oldObject, SchemaObject newObject)
          Updates the definition of an object.
 void updateSchema(Schema oldSchema, Schema newSchema)
          Updates the definition of a Schema.
 void validateObject(SchemaObject object)
          Checks to see if the object is valid.
 
Methods inherited from class oracle.jdeveloper.cm.ds.db.AbstractDatabase
close, createObjects, createSchema, deleteObjects, exists, exists, getConnection, getConnectionName, getDatabaseSource, getDDLGenerator, isObjectValid, setDDLGenerator, update, updateObjects
 
Methods inherited from class oracle.jdeveloper.cm.ds.db.AbstractDBObjectProvider
addDataType, cacheObject, clearAllCaches, clearCache, convertObject, convertToExternal, convertToInternal, findByID, findObject, findSupportedDataType, getBuilderForType, getDataType, getExternalName, getExternalName, getInternalName, getInternalName, getObject, getValidatorForType, initializeDataTypes, isValidName, listObjects, listObjects, listObjectsImpl, listObjectTypes, listSupportedDataTypes, needsQuoting, quoteIdentifier, registerBuilder, registerValidator, removeDataType, uncacheObject, unregisterBuilder, unregisterValidator, validateObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jdeveloper.cm.ds.db.DBObjectProvider
getDataType, getExternalName, getExternalName, getInternalName, getInternalName, getObject, isValidName, listObjects, listObjects, listObjectTypes, listSupportedDataTypes, quoteIdentifier, validateObject
 

Field Detail

ODBC_NOT_IMPLEMENTED

public static final java.lang.String ODBC_NOT_IMPLEMENTED
See Also:
Constant Field Values

ANSI_CHARACTER

public static final DataType ANSI_CHARACTER

ANSI_CHARACTER_VARYING

public static final DataType ANSI_CHARACTER_VARYING

ANSI_NUMERIC

public static final DataType ANSI_NUMERIC

ANSI_DECIMAL

public static final DataType ANSI_DECIMAL

ANSI_INTEGER

public static final DataType ANSI_INTEGER

ANSI_INT

public static final DataType ANSI_INT

ANSI_SMALLINT

public static final DataType ANSI_SMALLINT

ANSI_FLOAT

public static final DataType ANSI_FLOAT

ANSI_DOUBLE_PRECISION

public static final DataType ANSI_DOUBLE_PRECISION

ANSI_REAL

public static final DataType ANSI_REAL

ANSI_DATE

public static final DataType ANSI_DATE

ANSI_TIME

public static final DataType ANSI_TIME
Constructor Detail

JdbcDatabase

public JdbcDatabase(java.lang.String connName,
                    java.sql.Connection conn)
Constructs a new JdbcDatabase.

Parameters:
connName - a String containing the ConnectionManager name for the connection associated with this Database
conn - the Connection used by this JdbcDatabase

JdbcDatabase

public JdbcDatabase(java.sql.Connection conn)
Method Detail

getCasePolicy

protected int getCasePolicy()
Description copied from class: AbstractDBObjectProvider
Retrieves the case policy in effect for this Database.

Specified by:
getCasePolicy in class AbstractDBObjectProvider
Returns:
the Database's case policy
See Also:
AbstractDBObjectProvider.LOWER_CASE_NAME_POLICY, AbstractDBObjectProvider.MIXED_CASE_NAME_POLICY, AbstractDBObjectProvider.UPPER_CASE_NAME_POLICY

registerBuilders

protected void registerBuilders()
Description copied from class: AbstractDatabase
Called to request that the DBOBjectBuilders be registered.

Specified by:
registerBuilders in class AbstractDatabase

registerDataTypes

protected void registerDataTypes()
Description copied from class: AbstractDatabase
Called to request that the datatypes be registered.

Specified by:
registerDataTypes in class AbstractDatabase

getDatabaseType

public java.lang.String getDatabaseType()
Description copied from interface: Database
Gets the type of database. This method uses JDBC metadata to determine the database type.

Returns:
an String describing the type of database
See Also:
DatabaseMetaData.getDatabaseProductName()

getTimestamp

public long getTimestamp(java.lang.String schema,
                         java.lang.String type,
                         java.lang.String objectName)
Description copied from interface: Database
Gets the timestamp of a PL/SQL Subprogram


supportsDebugging

public boolean supportsDebugging()
Description copied from interface: Database
Whether this database instance supports JDWP debugging. If the database does not support debugging, or only supports debugging using a custom protocol, this method should return false.

Returns:
true if JDWP debugging is supported against this database, false otherwise

getUserName

public java.lang.String getUserName()
                             throws DBException
Description copied from interface: Database
Retrieves the username used to connect to the database

Throws:
DBException

hasPriviledge

public boolean hasPriviledge(java.lang.String type,
                             Schema schema,
                             java.lang.String priv)
Description copied from interface: DBObjectProvider
Checks to see whether the user has the requisite permissions to perform the specified operation. For example, whether the user has permission to create a new table in a specific schema.

Specified by:
hasPriviledge in interface DBObjectProvider
Overrides:
hasPriviledge in class AbstractDBObjectProvider
Parameters:
type - the object type on which the operation is being performed.
schema - the schema to check. A value of null checks for the current schema.
priv - a pre-defined operation.
Returns:
whether the specified operation can be completed.

getIdentifierQuoteString

public java.lang.String getIdentifierQuoteString()
Description copied from interface: Database
Returns the String to use to quote SQL identifiers with

Specified by:
getIdentifierQuoteString in interface Database
Overrides:
getIdentifierQuoteString in class AbstractDBObjectProvider

canCreate

public boolean canCreate(SchemaObject object,
                         boolean replace)
Description copied from interface: DBObjectProvider
Whether an attempt to create the specified object is likely to succeed.

Specified by:
canCreate in interface DBObjectProvider
Specified by:
canCreate in class AbstractDBObjectProvider

canDelete

public boolean canDelete(SchemaObject object,
                         boolean cascade)
Description copied from interface: DBObjectProvider
Checks to see whether a specific object can be deleted.

Specified by:
canDelete in interface DBObjectProvider
Specified by:
canDelete in class AbstractDBObjectProvider

createObject

public void createObject(SchemaObject object,
                         boolean replace)
                  throws DBException
Description copied from interface: DBObjectProvider
Causes the creation of the object described by the specified meta data.

Specified by:
createObject in interface DBObjectProvider
Specified by:
createObject in class AbstractDBObjectProvider
Throws:
DBException

deleteObject

public void deleteObject(SchemaObject object,
                         boolean cascade)
                  throws DBException
Description copied from interface: DBObjectProvider
Deletes the object.

Specified by:
deleteObject in interface DBObjectProvider
Specified by:
deleteObject in class AbstractDBObjectProvider
Throws:
DBException

validateObject

public void validateObject(SchemaObject object)
                    throws ValidationException
Description copied from interface: DBObjectProvider
Checks to see if the object is valid.

Specified by:
validateObject in interface DBObjectProvider
Overrides:
validateObject in class AbstractDBObjectProvider
Throws:
ValidationException

updateObject

public void updateObject(SchemaObject oldObject,
                         SchemaObject newObject)
                  throws DBException
Description copied from interface: DBObjectProvider
Updates the definition of an object.

Specified by:
updateObject in interface DBObjectProvider
Specified by:
updateObject in class AbstractDBObjectProvider
Throws:
DBException

getSchema

public Schema getSchema(java.lang.String name)
                 throws DBException
Description copied from interface: DBObjectProvider
Retrieves the Schema object associated with a specific name.

Specified by:
getSchema in interface DBObjectProvider
Specified by:
getSchema in class AbstractDBObjectProvider
Throws:
DBException

getUniqueName

public java.lang.String getUniqueName(java.lang.String type,
                                      Schema schema,
                                      java.lang.String base)
Description copied from interface: DBObjectProvider
Retrieves a unique name for an object of a specific type.

Specified by:
getUniqueName in interface DBObjectProvider
Specified by:
getUniqueName in class AbstractDBObjectProvider

listSchemas

public Schema[] listSchemas()
                     throws DBException
Description copied from interface: DBObjectProvider
Retrieves the list of schemas available from this provider.

Specified by:
listSchemas in interface DBObjectProvider
Specified by:
listSchemas in class AbstractDBObjectProvider
Throws:
DBException

canCreate

public boolean canCreate(Schema schema,
                         boolean replace)
Description copied from interface: DBObjectProvider
Whether an attempt to create the specified schema is likely to succeed.

Specified by:
canCreate in interface DBObjectProvider
Specified by:
canCreate in class AbstractDBObjectProvider

createSchema

public void createSchema(Schema schema,
                         boolean replace)
                  throws DBException
Description copied from interface: DBObjectProvider
Causes the creation of a new Schema in the persistent storage.

Specified by:
createSchema in interface DBObjectProvider
Specified by:
createSchema in class AbstractDBObjectProvider
Throws:
DBException

canDelete

public boolean canDelete(Schema schema,
                         boolean cascade)
Description copied from interface: DBObjectProvider
Checks to see whether a specific schema can be deleted.

Specified by:
canDelete in interface DBObjectProvider
Specified by:
canDelete in class AbstractDBObjectProvider

deleteSchema

public void deleteSchema(Schema schema,
                         boolean cascade)
                  throws DBException
Description copied from interface: DBObjectProvider
Deletes the schema.

Specified by:
deleteSchema in interface DBObjectProvider
Specified by:
deleteSchema in class AbstractDBObjectProvider
Throws:
DBException

updateSchema

public void updateSchema(Schema oldSchema,
                         Schema newSchema)
                  throws DBException
Description copied from interface: DBObjectProvider
Updates the definition of a Schema.

Specified by:
updateSchema in interface DBObjectProvider
Specified by:
updateSchema in class AbstractDBObjectProvider
Throws:
DBException

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.