SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

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

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

public class DB2Dictionary
extends AbstractDictionary

Implementation of the DBDictionary interface for IBM DB2.


Fields inherited from class com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
CENTI, DECI, meta, MICRO, MILLI, NANO, NUMBER_FORMAT, SEC
 
Constructor Summary
DB2Dictionary()
           
 
Method Summary
 SQLBuffer addForUpdateClause(SQLBuffer buffer, String[] cols, String[] tables, SQLBuffer where, SQLBuffer order, boolean distinct, boolean update)
          DB2 does not allows "FOR UPDATE" clauses in statements that contain multiple tables.
 void blobToPreparedParameter(PreparedStatement st, int index, Object val)
           
 Object charToSQL(char val)
          Convert data into SQL for the current database platform.
protected  boolean dropTableDropsIndices()
          DB2 automatically drops all indices when we drop the tables; since schema manipulation can be so slow, this can be a significant performance improvement when reloading tables.
 SQLBuffer[] getDropColumnSQL(Column column)
          DB2 can't deal with dropping columns.
 int getMaxIndexNameLength()
           
 int getMaxTableNameLength()
           
 String getPlatform()
          Return the title of this database platform, used for display only.
 PreparedStatement prepareStatement(Connection conn, SQLBuffer buffer, SQLExecutionManager manager, int type, int concur)
          DB2 does not allow "SELECT ...
protected  void setupSQLTypeMap(SQLTypeMap map)
          This limits the upper size on BLOB and CLOB to 1 megabyte.
 boolean supportsLocking()
          This could probably be done better.
 
Methods inherited from class com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
, bigDecimalFromSQL, bigDecimalToPreparedParameter, bigDecimalToSQL, bigIntegerFromSQL, bigIntegerToPreparedParameter, bigIntegerToSQL, blobFromSQL, blobToSQL, booleanFromSQL, booleanToPreparedParameter, booleanToSQL, byteFromSQL, byteToPreparedParameter, byteToSQL, characterToPreparedParameter, charFromSQL, clobFromSQL, clobToPreparedParameter, clobToSQL, colsToString, createdSQLExecutionManager, dateFromSQL, dateToPreparedParameter, dateToSQL, dateToTimestamp, deserialize, deserialize, doubleFromSQL, doubleToPreparedParameter, doubleToSQL, floatFromSQL, floatToPreparedParameter, floatToSQL, fromSQL, getAddColumnSQL, getClassMappingCandidateClasses, getColumnDeclaration, getColumns, getCreateIndexSQL, getCreateTableSQL, getCreateTableSuffix, getDatePrecision, getDBMetaData, getDropIndexSQL, getDropTableSQL, getFieldMappingCandidateClasses, getMaxColumnNameLength, getNameTruncationVersion, getNextAutoIncrementValue, getNonSQL92LeftOuterJoin, 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, 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, supportsNonSQL92LeftOuterJoins, supportsUpdateCountsForBatch, tablesToString, timestampFromSQL, toPreparedParameter, toSelect, toSelect, toSelect, toSQL, truncate, truncate, validateConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB2Dictionary

public DB2Dictionary()
Method Detail

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

getDropColumnSQL

public SQLBuffer[] getDropColumnSQL(Column column)
DB2 can't deal with dropping columns.
Overrides:
getDropColumnSQL in class AbstractDictionary

setupSQLTypeMap

protected void setupSQLTypeMap(SQLTypeMap map)
This limits the upper size on BLOB and CLOB to 1 megabyte.
Overrides:
setupSQLTypeMap in class AbstractDictionary

getMaxTableNameLength

public int getMaxTableNameLength()
Overrides:
getMaxTableNameLength in class AbstractDictionary
Following copied from class: com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
Returns:
The maximum length of table names allowed in this database. Defaults to 30.

getMaxIndexNameLength

public int getMaxIndexNameLength()
Overrides:
getMaxIndexNameLength in class AbstractDictionary
Following copied from class: com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
Returns:
The maximum length of index names allowed in this database. Defaults to 30.

supportsLocking

public boolean supportsLocking()
This could probably be done better. DB2 does understand FOR UPDATE sometimes, but not always.
Overrides:
supportsLocking in class AbstractDictionary

charToSQL

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

dropTableDropsIndices

protected boolean dropTableDropsIndices()
DB2 automatically drops all indices when we drop the tables; since schema manipulation can be so slow, this can be a significant performance improvement when reloading tables.
Overrides:
dropTableDropsIndices in class AbstractDictionary

prepareStatement

public PreparedStatement prepareStatement(Connection conn,
                                          SQLBuffer buffer,
                                          SQLExecutionManager manager,
                                          int type,
                                          int concur)
                                   throws SQLException
DB2 does not allow "SELECT ... FOR UPDATE" statements to be executed against scrollable cursors.
Overrides:
prepareStatement in class AbstractDictionary
Following copied from interface: com.solarmetric.kodo.impl.jdbc.schema.DBDictionary
Returns:
the newly prepared statement

addForUpdateClause

public SQLBuffer addForUpdateClause(SQLBuffer buffer,
                                    String[] cols,
                                    String[] tables,
                                    SQLBuffer where,
                                    SQLBuffer order,
                                    boolean distinct,
                                    boolean update)
DB2 does not allows "FOR UPDATE" clauses in statements that contain multiple tables. Exclude it for statements that query against multiple tables.
Overrides:
addForUpdateClause in class AbstractDictionary

blobToPreparedParameter

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

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

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