SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.impl.jdbc.schema.dict
Class OracleDictionary

java.lang.Object
  |
  +--com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
        |
        +--com.solarmetric.kodo.impl.jdbc.schema.dict.OracleDictionary
All Implemented Interfaces:
Configurable, DBDictionary

public class OracleDictionary
extends AbstractDictionary
implements Configurable

Implementation of the DBDictionary interface for Oracle.


Inner Class Summary
static class OracleDictionary.EmbeddedLob
           
 
Field Summary
(package private)  boolean checkedDriverForUpdateBug
           
static String EMPTY_BLOB_STRING
           
static String EMPTY_CLOB_STRING
           
(package private)  boolean isOracleJDBCDriver
          This parameter affects whether we will use the special Blob and Clob handling required by the Oracle JDBC driver.
 
Fields inherited from class com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
CENTI, DECI, meta, MICRO, MILLI, NANO, NUMBER_FORMAT, SEC
 
Constructor Summary
OracleDictionary()
           
 
Method Summary
 Object blobFromSQL(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 void blobToPreparedParameter(PreparedStatement st, int i, Object o)
           
 void blobToPreparedParameterOracle(PreparedStatement st, int i, Object o)
          Oracle requires special handling of Blobs.
 Object blobToSQL(Object val)
          Convert data into SQL for the current database platform.
 String clobFromSQL(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 void clobToPreparedParameter(PreparedStatement st, int i, Object clob)
           
 void clobToPreparedParameterOracle(PreparedStatement st, int i, Object clob)
          The Oracle JDBC driver requires special handling of Clobs.
 Object clobToSQL(Object val)
          Convert data into SQL for the current database platform.
 void endConfiguration()
          Invoked upon completion of configuration of this object
 ResultSet getColumns(String tableName, Connection conn)
          Oracle is very slow when retrieving column information from DatabaseMetaData.
 SQLBuffer[] getDropColumnSQL(Column column)
          Return a series of SQL statements to drop the given column from its table, including the deletion of any indices from the column.
 int getEmbeddedBlobMaxLength()
          Returns the maximum blob length (in bytes) that can be embedded in a prepared statement without any special handling.
 int getEmbeddedClobMaxLength()
          Returns the maximum clob length (in characters) that can be embedded in a prepared statement without any special handling.
 Class[] getFieldMappingCandidateClasses()
          Returns a list of possible FieldMapping classes for use with this DBDictionary.
 boolean getIsOracleJDBCDriver()
          Get whether this is using the Oracle JDBC driver, or another vendor's driver.
 String getNonSQL92LeftOuterJoin(String fromTableAlias, Column[] fromCols, String toTableAlias, Column[] toCols)
          Throws an unsupported option exception by default.
 String getPlatform()
          Return the title of this database platform, used for display only.
 boolean isDataDirectJDBCDriver()
           
 void setEmbeddedBlobMaxLength(int l)
          Sets the maximum blob length (in bytes) that can be embedded in a prepared statement without any special handling.
 void setEmbeddedClobMaxLength(int l)
          Sets the maximum clob length (in characters) that can be embedded in a prepared statement without any special handling.
 void setIsOracleJDBCDriver(boolean isOracleJDBCDriver)
          Set whether this is using the Oracle JDBC driver, or another vendor's driver.
protected  void setupSQLTypeMap(SQLTypeMap map)
          This is the most commonly overridden method when porting to a new database.
 void startConfiguration()
          Invoked before configuration is begun on this object
 boolean supportsLocking()
          We do support locking, but check here for a bug in some versions of the DataDirect driver that prevents the correct number of rows from being returned in "SELECT ...
 boolean supportsNonSQL92LeftOuterJoins()
          Returns false by default.
 boolean supportsUpdateCountsForBatch()
          Oracle always returns an array of -2 values for any call to Statement.executeBatch().
 SQLBuffer toSelect(String[] cols, String[] tables, SQLBuffer where, SQLBuffer order, boolean dstnct, boolean update)
          Appends the given pieces using standard SQL.
 
Methods inherited from class com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
, addForUpdateClause, bigDecimalFromSQL, bigDecimalToPreparedParameter, bigDecimalToSQL, bigIntegerFromSQL, bigIntegerToPreparedParameter, bigIntegerToSQL, booleanFromSQL, booleanToPreparedParameter, booleanToSQL, byteFromSQL, byteToPreparedParameter, byteToSQL, characterToPreparedParameter, charFromSQL, charToSQL, colsToString, createdSQLExecutionManager, dateFromSQL, dateToPreparedParameter, dateToSQL, dateToTimestamp, deserialize, deserialize, doubleFromSQL, doubleToPreparedParameter, doubleToSQL, dropTableDropsIndices, floatFromSQL, floatToPreparedParameter, floatToSQL, fromSQL, getAddColumnSQL, getClassMappingCandidateClasses, getColumnDeclaration, getCreateIndexSQL, getCreateTableSQL, getCreateTableSuffix, getDatePrecision, getDBMetaData, getDropIndexSQL, getDropTableSQL, getMaxColumnNameLength, getMaxIndexNameLength, getMaxTableNameLength, getNameTruncationVersion, getNextAutoIncrementValue, getPrimaryKeyClause, getQuoteNumbers, getSchemaName, getSimulateLocking, getSQLTypeMap, getStoreCharsAsStrings, getStoreLargeNumbersAsStrings, getSupportedResultSetType, getTables, getValidateConnections, getValidateConnectionSQL, getValidColumnName, getValidIndexName, getValidTableName, initTypeMap, intFromSQL, intToPreparedParameter, intToSQL, isClosed, localeFromSQL, localeToPreparedParameter, localeToSQL, longFromSQL, longToPreparedParameter, longToSQL, objectFromSQL, objectToPreparedParameter, objectToSQL, prepareLargeNumberAsString, prepareStatement, serialize, setColumnNameGenerator, setCreateTableSuffix, setDBMetaData, setIndexNameGenerator, setMaxColumnNameLength, setMaxIndexNameLength, setMaxTableNameLength, setNameTruncationVersion, setNullParameter, setQuoteNumbers, setSchemaName, setSimulateLocking, setStoreCharsAsStrings, setStoreLargeNumbersAsStrings, setTableNameGenerator, setTransactionIsolation, setValidateConnections, setValidateConnectionSQL, shortFromSQL, shortToPreparedParameter, shortToSQL, stringFromSQL, stringToPreparedParameter, stringToSQL, supportsAutoIncrement, tablesToString, timestampFromSQL, toPreparedParameter, toSelect, toSelect, toSQL, truncate, truncate, validateConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isOracleJDBCDriver

boolean isOracleJDBCDriver
This parameter affects whether we will use the special Blob and Clob handling required by the Oracle JDBC driver.

checkedDriverForUpdateBug

boolean checkedDriverForUpdateBug

EMPTY_BLOB_STRING

public static final String EMPTY_BLOB_STRING

EMPTY_CLOB_STRING

public static final String EMPTY_CLOB_STRING
Constructor Detail

OracleDictionary

public OracleDictionary()
Method Detail

supportsNonSQL92LeftOuterJoins

public boolean supportsNonSQL92LeftOuterJoins()
Description copied from class: AbstractDictionary
Returns false by default.
Overrides:
supportsNonSQL92LeftOuterJoins in class AbstractDictionary

getNonSQL92LeftOuterJoin

public String getNonSQL92LeftOuterJoin(String fromTableAlias,
                                       Column[] fromCols,
                                       String toTableAlias,
                                       Column[] toCols)
Description copied from class: AbstractDictionary
Throws an unsupported option exception by default.
Overrides:
getNonSQL92LeftOuterJoin in class AbstractDictionary

toSelect

public SQLBuffer toSelect(String[] cols,
                          String[] tables,
                          SQLBuffer where,
                          SQLBuffer order,
                          boolean dstnct,
                          boolean update)
Description copied from class: AbstractDictionary
Appends the given pieces using standard SQL.
Overrides:
toSelect in class AbstractDictionary
Following copied from interface: com.solarmetric.kodo.impl.jdbc.schema.DBDictionary
Parameters:
cols - list of values the columns to select
tables - list of the tables to select from
where - the WHERE conditions; may be null if none
order - the ORDER BY conditions; may be null if none
distinct - if true, this should be a SELECT DISTINCT-equivalent query
update - if true this should be a SELECT FOR UPDATE-equivalent query

isDataDirectJDBCDriver

public boolean isDataDirectJDBCDriver()

supportsLocking

public boolean supportsLocking()
We do support locking, but check here for a bug in some versions of the DataDirect driver that prevents the correct number of rows from being returned in "SELECT ... FOR UPDATE" statements.
Overrides:
supportsLocking in class AbstractDictionary

getPlatform

public String getPlatform()
Description copied from class: AbstractDictionary
Return the title of this database platform, used for display only.
Overrides:
getPlatform in class AbstractDictionary

blobToSQL

public Object blobToSQL(Object val)
Description copied from interface: DBDictionary
Convert data into SQL for the current database platform.
Overrides:
blobToSQL in class AbstractDictionary

clobToSQL

public Object clobToSQL(Object val)
Description copied from interface: DBDictionary
Convert data into SQL for the current database platform.
Overrides:
clobToSQL in class AbstractDictionary

blobFromSQL

public Object blobFromSQL(ResultSet rs,
                          int column)
                   throws SQLException
Description copied from interface: DBDictionary
Convert the specified column of the SQL ResultSet to the proper java type.
Overrides:
blobFromSQL in class AbstractDictionary

blobToPreparedParameter

public void blobToPreparedParameter(PreparedStatement st,
                                    int i,
                                    Object o)
                             throws SQLException
Overrides:
blobToPreparedParameter in class AbstractDictionary

blobToPreparedParameterOracle

public void blobToPreparedParameterOracle(PreparedStatement st,
                                          int i,
                                          Object o)
                                   throws SQLException
Oracle requires special handling of Blobs.

clobFromSQL

public String clobFromSQL(ResultSet rs,
                          int column)
                   throws SQLException
Description copied from interface: DBDictionary
Convert the specified column of the SQL ResultSet to the proper java type.
Overrides:
clobFromSQL in class AbstractDictionary

clobToPreparedParameter

public void clobToPreparedParameter(PreparedStatement st,
                                    int i,
                                    Object clob)
                             throws SQLException
Overrides:
clobToPreparedParameter in class AbstractDictionary

clobToPreparedParameterOracle

public void clobToPreparedParameterOracle(PreparedStatement st,
                                          int i,
                                          Object clob)
                                   throws SQLException
The Oracle JDBC driver requires special handling of Clobs.

getDropColumnSQL

public SQLBuffer[] getDropColumnSQL(Column column)
Description copied from interface: DBDictionary
Return a series of SQL statements to drop the given column from its table, including the deletion of any indices from the column.
Overrides:
getDropColumnSQL in class AbstractDictionary

setupSQLTypeMap

protected void setupSQLTypeMap(SQLTypeMap map)
Description copied from class: AbstractDictionary
This is the most commonly overridden method when porting to a new database. Most databases have different mappings between java and SQL types; this method can be used to setup the mappings for the database being ported.
Overrides:
setupSQLTypeMap in class AbstractDictionary

getFieldMappingCandidateClasses

public Class[] getFieldMappingCandidateClasses()
Description copied from interface: DBDictionary
Returns a list of possible FieldMapping classes for use with this DBDictionary.
Overrides:
getFieldMappingCandidateClasses in class AbstractDictionary

getColumns

public ResultSet getColumns(String tableName,
                            Connection conn)
                     throws SQLException
Oracle is very slow when retrieving column information from DatabaseMetaData. Since we only need the "COLUMN_NAME" and "TABLE_NAME" fields as the contract for this method, we merely return the the result of the following SQL:

SELECT TABLE_NAME, COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME LIKE 'tableName'

Overrides:
getColumns in class AbstractDictionary

supportsUpdateCountsForBatch

public boolean supportsUpdateCountsForBatch()
Oracle always returns an array of -2 values for any call to Statement.executeBatch().
Overrides:
supportsUpdateCountsForBatch in class AbstractDictionary

startConfiguration

public void startConfiguration()
Description copied from interface: Configurable
Invoked before configuration is begun on this object
Specified by:
startConfiguration in interface Configurable

endConfiguration

public void endConfiguration()
Description copied from interface: Configurable
Invoked upon completion of configuration of this object
Specified by:
endConfiguration in interface Configurable

setIsOracleJDBCDriver

public void setIsOracleJDBCDriver(boolean isOracleJDBCDriver)
Set whether this is using the Oracle JDBC driver, or another vendor's driver. This parameter affects how Clobs and Blobs are handled; the Oracle JDBC driver requires special handling of these types.

getIsOracleJDBCDriver

public boolean getIsOracleJDBCDriver()
Get whether this is using the Oracle JDBC driver, or another vendor's driver. This parameter affects how Clobs and Blobs are handled; the Oracle JDBC driver requires special handling of these types.

setEmbeddedBlobMaxLength

public void setEmbeddedBlobMaxLength(int l)
Sets the maximum blob length (in bytes) that can be embedded in a prepared statement without any special handling. Defaults to 4000.

getEmbeddedBlobMaxLength

public int getEmbeddedBlobMaxLength()
Returns the maximum blob length (in bytes) that can be embedded in a prepared statement without any special handling. Defaults to 4000.

setEmbeddedClobMaxLength

public void setEmbeddedClobMaxLength(int l)
Sets the maximum clob length (in characters) that can be embedded in a prepared statement without any special handling. Defaults to 4000.

getEmbeddedClobMaxLength

public int getEmbeddedClobMaxLength()
Returns the maximum clob length (in characters) that can be embedded in a prepared statement without any special handling. Defaults to 4000.

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.