kodo.jdbc.sql
Class InformixDictionary
java.lang.Object
|
+--kodo.jdbc.sql.DBDictionary
|
+--kodo.jdbc.sql.InformixDictionary
- All Implemented Interfaces:
- Configurable, ConnectionDecorator
- public class InformixDictionary
- extends DBDictionary
Dictionary for Informix database. Notable features:
- Informix does not allow pessimistic locking on scrollable result
sets.
- SET LOCK MODE TO WAIT N statements are issued to wait on locks. See
getLockWaitSeconds() and getLockModeEnabled().
- LOCK MODE ROW is used by default for table creation to allow the
maximum concurrency.
|
Method Summary |
void |
configureReflectedColumn(Column col,
String typeName)
Configure the specified column with the typeName from
the DatabaseMetaData. |
Connection |
decorate(Connection conn)
Decorate the given connection if needed. |
String |
getClobString(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper
java type. |
protected boolean |
getConstraintNameBeforeDeclaration()
Informix requires that constraint names come after the
constraint declaration. |
String[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, complete
with columns. |
boolean |
getLockModeEnabled()
If true, then we will issue a "SET LOCK MODE TO WAIT N"
statement whenever we create a Connection, in order
allow waiting on locks. |
int |
getLockWaitSeconds()
If getLockModeEnabled() is true, then this
parameter specifies the number of seconds we will wait to
obtain a lock for inserts and pessimistic locking. |
boolean |
getSwapSchemaAndCatalog()
Informix JDBC metadata for all known drivers returns with the
table catalog and the table schema name swapped. |
ColumnInfo |
newColumnInfo(ResultSet rs)
Construct a new ColumnInfo from the given ResultSet |
IndexInfo |
newIndexInfo(ResultSet rs)
Construct a new IndexInfo from the given ResultSet |
PrimaryKeyInfo |
newPrimaryKeyInfo(ResultSet rs)
Construct a new PrimaryKeyInfo from the given ResultSet |
FieldMapping |
replaceMapping(FieldMapping mapping)
Replace the given mapping with one suited to this database, or return
the original if no replacement is needed. |
void |
setBoolean(PreparedStatement stmnt,
int idx,
boolean val)
Set the given value as a parameter to the statement. |
void |
setDBMetaData(DBMetaData meta)
Set the database metadata for this dictionary. |
void |
setLockModeEnabled(boolean lockModeEnabled)
If true, then we will issue a "SET LOCK MODE TO WAIT N"
statement whenever we create a Connection, in order
allow waiting on locks. |
void |
setLockWaitSeconds(int lockWaitSeconds)
If getLockModeEnabled() is true, then this
parameter specifies the number of seconds we will wait to
obtain a lock for inserts and pessimistic locking. |
void |
setSwapSchemaAndCatalog(boolean swapSchemaAndCatalog)
Informix JDBC metadata for all known drivers returns with the
table catalog and the table schema name swapped. |
void |
setup(Select sel)
Configure the result set type and concurrency for the given select,
if needed. |
protected boolean |
supportsSizeInColumnDefinition(Column col,
String name)
Returns true if a schema definition statement supports appending
the size after the column type. |
| Methods inherited from class kodo.jdbc.sql.DBDictionary |
addSystemSchema, addSystemTable, appendSize, canBatch, canLock, convertSchemaCase, endConfiguration, getAddColumnSQL, getAddForeignKeySQL, getAddPrimaryKeySQL, getArray, getAsciiStream, getAutoIncrementClause, getAutoIncrementTypeName, getBatchLimit, getBatchParameterLimit, getBigDecimal, getBigInteger, getBigintTypeName, getBinaryStream, getBinaryTypeName, getBitTypeName, getBlob, getBlobObject, getBlobStream, getBlobTypeName, getBoolean, getByte, getBytes, getCatalogNameForMetadata, getCatalogSeparator, getChar, getCharacterStream, getCharTypeName, getClob, getClobTypeName, getColumnNameForMetadata, getColumns, getConfiguration, getCreateIndexSQL, getCreatePrimaryKeys, getDate, getDate, getDatePrecision, getDateTypeName, getDBMetaData, getDecimalTypeName, getDeclareColumnSQL, getDistinctTypeName, getDouble, getDoubleTypeName, getDropColumnSQL, getDropForeignKeySQL, getDropIndexSQL, getDropPrimaryKeySQL, getDropTableSQL, getFloat, getFloatTypeName, getForeignKeyActionName, getForeignKeyConstraintSQL, getForUpdateClause, getFrom, getFullName, getFullName, getGeneratedKey, getImportedKeys, getIndexInfo, getInitializationSQL, getInt, getIntegerTypeName, getJavaObjectTypeName, getJDBCType, getJoinSyntax, getJoinSyntaxConstant, getLastGeneratedKeyQuery, getLastGeneratedKeyQuery, getLocale, getLong, getLongVarbinaryTypeName, getLongVarcharTypeName, getMaxCharacterFieldLength, getMaxColumnNameLength, getMaxForeignKeyNameLength, getMaxIndexesPerTable, getMaxIndexNameLength, getMaxKeyNameLength, getMaxPrimaryKeyNameLength, getMaxTableNameLength, getNullTypeName, getNumericTypeName, getObject, getOrderings, getOtherTypeName, getPlatform, getPreferredType, getPrimaryKeyConstraintSQL, getPrimaryKeys, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getRealTypeName, getRef, getRefTypeName, getReservedKeywords, getReservedWords, getSchemaCase, getSchemaNameForMetadata, getSelects, getShort, getSimulateLocking, getSizeClause, getSmallintTypeName, getStorageLimitationsFatal, getStoreCharsAsNumbers, getStoreLargeNumbersAsStrings, getString, getStructTypeName, getSupportsDeferredConstraints, getSupportsForeignKeys, getSupportsLockingWithDistinctClause, getSupportsLockingWithInnerJoin, getSupportsLockingWithMultipleTables, getSupportsLockingWithOrderClause, getSupportsLockingWithOuterJoin, getSupportsMultipleNontransactionalResultSets, getSupportsNullTableForGetColumns, getSupportsNullTableForGetImportedKeys, getSupportsNullTableForGetIndexInfo, getSupportsNullTableForGetPrimaryKeys, getSupportsSchemaForGetColumns, getSupportsSchemaForGetTables, getSupportsSelectForUpdate, getSystemSchemas, getSystemTables, getTableForUpdateClause, getTableNameForMetadata, getTables, getTableTypes, getTime, getTimestamp, getTimestampTypeName, getTimeTypeName, getTinyintTypeName, getTypeName, getUseGetBestRowIdentifierForPrimaryKeys, getUseGetBytesForBlobs, getUseGetObjectForBlobs, getUseSchemaName, getUseSetBytesForBlobs, getUseStringsForClobs, getValidationSQL, getValidColumnName, getValidForeignKeyName, getValidIndexName, getValidPrimaryKeyName, getValidTableName, getVarbinaryTypeName, getVarcharTypeName, getWhere, isReserved, isSupported, isSystemIndex, isSystemTable, makeNameValid, maxKeyNameLength, newForeignKeyInfo, newTableInfo, refSchemaComponents, replaceMapping, replaceMappingFactory, replaceSchemaFactory, replaceSize, serialize, setArray, setAsciiStream, setAutoIncrementClause, setAutoIncrementTypeName, setBatchLimit, setBatchParameterLimit, setBigDecimal, setBigInteger, setBigintTypeName, setBinaryStream, setBinaryTypeName, setBitTypeName, setBlob, setBlobObject, setBlobTypeName, setByte, setBytes, setCatalogSeparator, setChar, setCharacterStream, setCharTypeName, setClob, setClobString, setClobTypeName, setConfiguration, setCreatePrimaryKeys, setDate, setDate, setDateTypeName, setDecimalTypeName, setDistinctTypeName, setDouble, setDoubleTypeName, setFloat, setFloatTypeName, setForUpdateClause, setInitializationSQL, setInt, setIntegerTypeName, setJavaObjectTypeName, setJoinSyntax, setJoinSyntaxConstant, setLastGeneratedKeyQuery, setLocale, setLong, setLongVarbinaryTypeName, setLongVarcharTypeName, setMaxIndexesPerTable, setMaxKeyNameLength, setNull, setNullTypeName, setNumericTypeName, setObject, setOtherTypeName, setPlatform, setRealTypeName, setRef, setRefTypeName, setReservedWords, setSchemaCase, setShort, setSimulateLocking, setSmallintTypeName, setStorageLimitationsFatal, setStoreCharsAsNumbers, setStoreLargeNumbersAsStrings, setString, setStructTypeName, setSupportsDeferredConstraints, setSupportsForeignKeys, setSupportsLockingWithDistinctClause, setSupportsLockingWithInnerJoin, setSupportsLockingWithMultipleTables, setSupportsLockingWithOrderClause, setSupportsLockingWithOuterJoin, setSupportsMultipleNontransactionalResultSets, setSupportsNullTableForGetColumns, setSupportsNullTableForGetImportedKeys, setSupportsNullTableForGetIndexInfo, setSupportsNullTableForGetPrimaryKeys, setSupportsSchemaForGetColumns, setSupportsSchemaForGetTables, setSupportsSelectForUpdate, setSystemSchemas, setSystemTables, setTableForUpdateClause, setTableTypes, setTime, setTimestamp, setTimestampTypeName, setTimeTypeName, setTinyintTypeName, setUseGetBestRowIdentifierForPrimaryKeys, setUseGetBytesForBlobs, setUseGetObjectForBlobs, setUseSchemaName, setUseSetBytesForBlobs, setUseStringsForClobs, setValidationSQL, setVarbinaryTypeName, setVarcharTypeName, startConfiguration, storageWarning, supportsAutoIncrement, supportsForeignKey, supportsSelectForUpdate, supportsTotalCountsForBatch, supportsUpdateCountsForBatch, toNativeJoin, toSelect, toSelect, toSQL92Join, toTraditionalJoin, warnSupportedDictionary |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InformixDictionary
public InformixDictionary()
setDBMetaData
public void setDBMetaData(DBMetaData meta)
throws SQLException
- Description copied from class:
DBDictionary
- Set the database metadata for this dictionary. This method will
be called by the system.
- Overrides:
setDBMetaData in class DBDictionary
newColumnInfo
public ColumnInfo newColumnInfo(ResultSet rs)
throws SQLException
- Description copied from class:
DBDictionary
- Construct a new
ColumnInfo from the given ResultSet
- Overrides:
newColumnInfo in class DBDictionary
newPrimaryKeyInfo
public PrimaryKeyInfo newPrimaryKeyInfo(ResultSet rs)
throws SQLException
- Description copied from class:
DBDictionary
- Construct a new
PrimaryKeyInfo from the given ResultSet
- Overrides:
newPrimaryKeyInfo in class DBDictionary
newIndexInfo
public IndexInfo newIndexInfo(ResultSet rs)
throws SQLException
- Description copied from class:
DBDictionary
- Construct a new
IndexInfo from the given ResultSet
- Overrides:
newIndexInfo in class DBDictionary
setLockModeEnabled
public void setLockModeEnabled(boolean lockModeEnabled)
- If true, then we will issue a "SET LOCK MODE TO WAIT N"
statement whenever we create a
Connection, in order
allow waiting on locks.
getLockModeEnabled
public boolean getLockModeEnabled()
- If true, then we will issue a "SET LOCK MODE TO WAIT N"
statement whenever we create a
Connection, in order
allow waiting on locks.
setLockWaitSeconds
public void setLockWaitSeconds(int lockWaitSeconds)
- If
getLockModeEnabled() is true, then this
parameter specifies the number of seconds we will wait to
obtain a lock for inserts and pessimistic locking.
getLockWaitSeconds
public int getLockWaitSeconds()
- If
getLockModeEnabled() is true, then this
parameter specifies the number of seconds we will wait to
obtain a lock for inserts and pessimistic locking.
getClobString
public String getClobString(ResultSet rs,
int column)
throws SQLException
- Description copied from class:
DBDictionary
- Convert the specified column of the SQL ResultSet to the proper
java type.
- Overrides:
getClobString in class DBDictionary
supportsSizeInColumnDefinition
protected boolean supportsSizeInColumnDefinition(Column col,
String name)
- Description copied from class:
DBDictionary
- Returns true if a schema definition statement supports appending
the size after the column type. For example some databases
allow FLOAT(20), but other databases disallow INT8(16).
- Overrides:
supportsSizeInColumnDefinition in class DBDictionary
setBoolean
public void setBoolean(PreparedStatement stmnt,
int idx,
boolean val)
throws SQLException
- Description copied from class:
DBDictionary
- Set the given value as a parameter to the statement.
- Overrides:
setBoolean in class DBDictionary
configureReflectedColumn
public void configureReflectedColumn(Column col,
String typeName)
- Description copied from class:
DBDictionary
- Configure the specified column with the typeName from
the
DatabaseMetaData.
- Overrides:
configureReflectedColumn in class DBDictionary
- Following copied from class:
kodo.jdbc.sql.DBDictionary
- Parameters:
col - the Column to configuretypeName - the TYPE_NAME as reported by the metadata
getConstraintNameBeforeDeclaration
protected boolean getConstraintNameBeforeDeclaration()
- Informix requires that constraint names come after the
constraint declaration.
- Overrides:
getConstraintNameBeforeDeclaration in class DBDictionary
getCreateTableSQL
public String[] getCreateTableSQL(Table table)
- Description copied from class:
DBDictionary
- Return a series of SQL statements to create the given table, complete
with columns. Indexes and constraints will be created separately.
- Overrides:
getCreateTableSQL in class DBDictionary
setup
public void setup(Select sel)
- Description copied from class:
DBDictionary
- Configure the result set type and concurrency for the given select,
if needed. Does nothing by default.
- Overrides:
setup in class DBDictionary
decorate
public Connection decorate(Connection conn)
throws SQLException
- Description copied from class:
DBDictionary
- Decorate the given connection if needed. Some databases require special
handling for JDBC bugs. This method will also issue any
initialization SQL is the
DBDictionary.getInitializationSQL() method does
not return null.
- Overrides:
decorate in class DBDictionary
replaceMapping
public FieldMapping replaceMapping(FieldMapping mapping)
- Description copied from class:
DBDictionary
- Replace the given mapping with one suited to this database, or return
the original if no replacement is needed. Returns the original by
default.
- Overrides:
replaceMapping in class DBDictionary
setSwapSchemaAndCatalog
public void setSwapSchemaAndCatalog(boolean swapSchemaAndCatalog)
- Informix JDBC metadata for all known drivers returns with the
table catalog and the table schema name swapped. A
true
value for this property indicates that they should be reversed.
getSwapSchemaAndCatalog
public boolean getSwapSchemaAndCatalog()
- Informix JDBC metadata for all known drivers returns with the
table catalog and the table schema name swapped. A
true
value for this property indicates that they should be reversed.
Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.