|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jdeveloper.cm.ds.db.JdbcDatabase
Implementation of the Database interface for use with JDBC Connections,
currently this implementation handles all three types of database types
(DATABASE_TYPE_GENERIC
, DATABASE_TYPE_ORACLE
,
and DATABASE_TYPE_ORACLE_LITE
). In the future it may be
required to refactor this class into one class per type, but since the
variation is still minimal, this class serves for now.
Database.DATABASE_TYPE_GENERIC
,
Database.DATABASE_TYPE_ORACLE
,
Database.DATABASE_TYPE_ORACLELITE
Field Summary | |
protected java.sql.Connection |
_conn
JDBC Connection to the database |
protected java.lang.String |
_connName
Connection Manager name of the connection or null if not using cm |
protected java.util.List |
databaseObjectTypes
List of database object types supported by this database |
static java.lang.String |
SQLSTATE_NOT_IMPLEMENTED
|
Fields inherited from interface oracle.jdeveloper.cm.ds.db.Database |
DATABASE_TYPE_GENERIC, DATABASE_TYPE_ORACLE, DATABASE_TYPE_ORACLELITE |
Constructor Summary | |
protected |
JdbcDatabase(java.sql.Connection conn)
Constructor - Created a JDBC Database and connection |
protected |
JdbcDatabase(java.lang.String connName)
Constructor - Created a JDBC Database and connection |
protected |
JdbcDatabase(java.lang.String connName,
java.sql.Connection conn)
Constructor |
Method Summary | |
protected Table |
_createTable(java.lang.String schema,
java.lang.String tableName)
|
protected java.util.List |
_getColumns(java.lang.String schema,
java.lang.String tableName)
|
protected java.util.List |
_getConstraints(java.lang.String schema,
java.lang.String tableName)
|
void |
close()
Close the Database Connection (and the supplied JDBC Connection) |
java.sql.ResultSet |
executeQuery(java.lang.String sqlStmt)
Get a ResultSet from a query This function may also set data returned by getLastResultString() or getLastErrorText(). |
abstract boolean |
exists(java.lang.String schema,
java.lang.String type,
java.lang.String objectName)
Checks for existance of a schema object named objectName . |
java.sql.Connection |
getConnection()
Get the JDBC connection associated with this database |
java.lang.String |
getConnectionName()
Get the Connection Manager connection name |
int |
getDatabaseType()
Get the type of database. |
protected int |
getDatabaseTypeImpl()
|
java.lang.String |
getIdentifierQuoteString()
Returns the String to use to quote SQL identifiers with |
java.lang.String |
getLastErrorText()
Get the last error text returned by executeQuery |
java.lang.String |
getLastResultString()
Gets the last message returned by executeQuery when no ResultSet was returned. |
java.util.List |
getObjects(int dbObjectType,
java.lang.String schema)
Gets a list of the database objects for a given username and object type |
java.util.List |
getObjects(int dbObjectType,
java.lang.String schema,
java.lang.String ref)
Gets a list of the database objects for a given username and object type associated with the ref object. |
java.util.Iterator |
getObjectTypes()
Get the types of database objects supported. |
Sequence |
getSequence(java.lang.String schema,
java.lang.String sequenceName)
Creates a Sequence datamodel. |
Synonym |
getSynonym(java.lang.String schema,
java.lang.String synonymName)
Creates a Synonym datamodel. |
int |
getSynonymType(java.lang.String schema,
java.lang.String synonymName)
Gets the underlying type of a Synonym. |
Table |
getTable(java.lang.String schema,
java.lang.String tableName)
Creates a Table datamodel. |
abstract 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 |
getUniqueObjectName(java.lang.String schema,
int objectType,
java.lang.String baseName)
Retrieves a unique object name |
boolean |
isObjectValid(java.lang.String schemaName,
java.lang.String objectName,
int objectType)
Determines whether the specified database object is in a valid state. |
abstract boolean |
isValidName(java.lang.String objectName)
Checks the whether objectName is a valid name for a schema
Object. |
protected java.util.List |
queryDmdTables(java.lang.String schema,
java.lang.String catalog,
java.lang.String[] tbl_types)
|
boolean |
supportsDebugging()
Determines whether this database instance supports debugging. |
protected abstract java.lang.String |
transformSQLStatement(java.lang.String sql)
|
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.Database |
getFullVersion, getFullVersionString, getJavaObjects, getMajorVersion, getSource, isUserPrivileged |
Field Detail |
protected java.sql.Connection _conn
protected java.lang.String _connName
protected java.util.List databaseObjectTypes
public static final java.lang.String SQLSTATE_NOT_IMPLEMENTED
Constructor Detail |
protected JdbcDatabase(java.lang.String connName, java.sql.Connection conn)
connName
- name of the ConnectionManager connectionconn
- JDBC Connection object.
ConnectionManager
,
Connection
protected JdbcDatabase(java.lang.String connName)
connName
- name of the ConnectionManager connection
ConnectionManager
,
Connection
protected JdbcDatabase(java.sql.Connection conn)
conn
- JDBC Connection object.
ConnectionManager
,
Connection
Method Detail |
public java.sql.Connection getConnection()
Database
getConnection
in interface Database
Connection
public java.lang.String getConnectionName()
Database
getConnectionName
in interface Database
ConnectionManager
public int getDatabaseType()
Database
DATABASE_TYPE_ORACLE
DATABASE_TYPE_ORACLELITE
DATABASE_TYPE_GENERIC
getDatabaseType
in interface Database
Database.DATABASE_TYPE_GENERIC
,
Database.DATABASE_TYPE_ORACLE
,
Database.DATABASE_TYPE_ORACLELITE
,
java.sql.DatabaseMetaData.getDatabaseProductName
,
Database
,
JdbcDatabase
protected int getDatabaseTypeImpl()
public java.util.Iterator getObjectTypes()
Database
getObjectTypes
in interface Database
public java.util.List getObjects(int dbObjectType, java.lang.String schema)
Database
getObjects
in interface Database
dbObjectType
- Type of object.schema
- schema to query
public java.util.List getObjects(int dbObjectType, java.lang.String schema, java.lang.String ref)
Database
ref
object. Example: getting all of the
INDEX objects where the referenced Table is ref
.
getObjects
in interface Database
dbObjectType
- Type of object.schema
- schema to queryref
- Object Referenced for the query.
protected java.util.List queryDmdTables(java.lang.String schema, java.lang.String catalog, java.lang.String[] tbl_types) throws java.sql.SQLException
java.sql.SQLException
public void close()
Database
close
in interface Database
public java.lang.String getLastErrorText()
Database
getLastErrorText
in interface Database
null
if there was
no error on the last execution of a SQL statement.public java.lang.String getLastResultString()
Database
getLastResultString
in interface Database
null
if no text was returned.ResultSet
,
Database.executeQuery(String)
protected abstract java.lang.String transformSQLStatement(java.lang.String sql)
public java.sql.ResultSet executeQuery(java.lang.String sqlStmt)
Database
NOTE: The caller is responsible for closing the result set AND the statement associated with the result set.
executeQuery
in interface Database
sqlStmt
- The SQL Statement to execute
Database.getLastResultString()
,
Database.getLastErrorText()
,
ResultSet.getStatement()
public Table getTable(java.lang.String schema, java.lang.String tableName)
Database
Table
datamodel.
getTable
in interface Database
protected Table _createTable(java.lang.String schema, java.lang.String tableName)
protected java.util.List _getColumns(java.lang.String schema, java.lang.String tableName)
protected java.util.List _getConstraints(java.lang.String schema, java.lang.String tableName)
public Sequence getSequence(java.lang.String schema, java.lang.String sequenceName)
Database
Sequence
datamodel.
getSequence
in interface Database
public abstract boolean exists(java.lang.String schema, java.lang.String type, java.lang.String objectName)
Database
objectName
.
exists
in interface Database
objectName
- The name of the schema object.
true
if the object exists, false
otherwise.public abstract boolean isValidName(java.lang.String objectName)
Database
objectName
is a valid name for a schema
Object. This function will make all reasonable non-destructive tests,
but is not guaranteed to be 100% accurate.
isValidName
in interface Database
objectName
- The name of the schema object.
true
if the name is valid, false
otherwise.public boolean isObjectValid(java.lang.String schemaName, java.lang.String objectName, int objectType)
Database
isObjectValid
in interface Database
schemaName
- the name of the schema containing the objectobjectName
- the name of the objectobjectType
- the type of the object.DatabaseObjectType
public java.lang.String getIdentifierQuoteString()
Database
String
to use to quote SQL identifiers with
getIdentifierQuoteString
in interface Database
DatabaseMetaData.getIdentifierQuoteString()
public abstract long getTimestamp(java.lang.String schema, java.lang.String type, java.lang.String objectName)
Database
getTimestamp
in interface Database
public int getSynonymType(java.lang.String schema, java.lang.String synonymName)
Database
getSynonymType
in interface Database
public Synonym getSynonym(java.lang.String schema, java.lang.String synonymName)
Database
Synonym
datamodel.
getSynonym
in interface Database
null
if the
database does not support all the required functionality.public boolean supportsDebugging()
Database
supportsDebugging
in interface Database
public java.lang.String getUniqueObjectName(java.lang.String schema, int objectType, java.lang.String baseName)
Database
getUniqueObjectName
in interface Database
schema
- the schema to checkobjectType
- the type of objectbaseName
- the base name to use
|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©1997, 2003, Oracle. All rights reserved.