public class DB2Platform extends DatabasePlatform
Purpose: Provides DB2 specific behavior.
Responsibilities:
DEFAULT_VARCHAR_SIZEDEFAULT_MAX_BATCH_WRITING_SIZE, DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE, IS_VALID_TIMEOUT, shouldIgnoreCaseOnFieldComparisons, Types_NCLOB, Types_SQLXML| Constructor and Description |
|---|
DB2Platform() |
| Modifier and Type | Method and Description |
|---|---|
ValueReadQuery |
buildSelectQueryForIdentity()
INTERNAL: Build the identity query for native sequencing.
|
ValueReadQuery |
buildSelectQueryForSequenceObject(java.lang.String seqName,
java.lang.Integer size)
INTERNAL: DB2 added SEQUENCE support as of (I believe) v8.
|
boolean |
dontBindUpdateAllQueryUsingTempTables()
INTERNAL: DB2 has issues with binding with temp table queries.
|
int |
getMaxFieldNameSize()
INTERNAL: returns the maximum number of characters that can be used in a
field name on this platform.
|
int |
getMaxForeignKeyNameSize()
INTERNAL: returns the maximum number of characters that can be used in a
foreign key name on this platform.
|
int |
getMaxUniqueKeyNameSize()
INTERNAL:
returns the maximum number of characters that can be used in a unique key
name on this platform.
|
java.util.Vector |
getNativeTableInfo(java.lang.String table,
java.lang.String creator,
AbstractSession session)
INTERNAL:
Return the catalog information through using the native SQL catalog
selects.
|
java.lang.String |
getProcedureAsString()
INTERNAL:
Used for stored procedure defs.
|
java.lang.String |
getProcedureBeginString()
Used for stored procedure defs.
|
java.lang.String |
getProcedureCallHeader()
INTERNAL:
Used for sp calls.
|
java.lang.String |
getProcedureEndString()
INTERNAL:
Used for stored procedure defs.
|
java.lang.String |
getSelectForUpdateString()
INTERNAL:
Used for pessimistic locking in DB2.
|
DatabaseTable |
getTempTableForTable(DatabaseTable table)
INTERNAL: DB2 temp table syntax.
|
ValueReadQuery |
getTimestampQuery()
INTERNAL:
This method returns the query to select the timestamp from the server for
DB2.
|
void |
initializeConnectionData(java.sql.Connection connection)
INTERNAL:
Allow initialization from the connection.
|
boolean |
isAlterSequenceObjectSupported()
INTERNAL: DB2 added SEQUENCE support as of (I believe) v8.
|
boolean |
isDB2() |
boolean |
isDynamicSQLRequiredForFunctions()
INTERNAL
DB2 has some issues with using parameters on certain functions and relations.
|
boolean |
isNullAllowedInSelectClause()
INTERNAL: DB2 does not allow NULL in select clause.
|
java.util.Hashtable |
maximumNumericValues()
INTERNAL:
Builds a table of maximum numeric values keyed on java class.
|
java.util.Hashtable |
minimumNumericValues()
INTERNAL:
Builds a table of minimum numeric values keyed on java class.
|
void |
printFieldIdentityClause(java.io.Writer writer)
INTERNAL: Append the receiver's field 'identity' constraint clause to a
writer.
|
void |
printSQLSelectStatement(DatabaseCall call,
ExpressionSQLPrinter printer,
SQLSelectStatement statement)
INTERNAL:
Print the SQL representation of the statement on a stream, storing the fields
in the DatabaseCall.
|
boolean |
shouldIgnoreException(java.sql.SQLException exception)
INTERNAL:
Allow for the platform to ignore exceptions.
|
boolean |
shouldPrintForUpdateClause() |
boolean |
shouldPrintOutputTokenAtStart()
INTERNAL:
This is required in the construction of the stored procedures with output
parameters.
|
boolean |
shouldUseJDBCOuterJoinSyntax()
INTERNAL:
JDBC defines and outer join syntax, many drivers do not support this.
|
boolean |
supportsGlobalTempTables()
INTERNAL: DB2 supports temp tables.
|
boolean |
supportsIdentity()
INTERNAL: Indicates whether the platform supports identity.
|
boolean |
supportsLockingQueriesWithMultipleTables()
INTERNAL:
DB2 does not seem to allow FOR UPDATE on queries with multiple tables.
|
boolean |
supportsSequenceObjects()
INTERNAL: DB2 added SEQUENCE support as of (I believe) v8.
|
void |
writeParameterMarker(java.io.Writer writer,
ParameterExpression parameter,
AbstractRecord record,
DatabaseCall call)
INTERNAL:
DB2 requires casting on certain operations, such as the CONCAT function,
and parameterized queries of the form, ":param = :param".
|
addBatch, addStructConverter, allowsSizeInProcedureArguments, appendLiteralToCall, appendParameter, appendParameterInternal, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCallWithReturning, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, canBuildCallWithReturning, commitTransaction, computeMaxRowsForSQL, convertToDatabaseType, copyInto, createArray, createArray, createStruct, createStruct, executeBatch, executeStoredProcedure, freeTemporaryObject, getAssignmentString, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getBatchRowCountAssignString, getBatchRowCountDeclareString, getBatchRowCountReturnString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConnectionUserName, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getDriverSupportsNVarChar, getDropCascadeString, getDropDatabaseSchemaString, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIdentifierQuoteCharacter, getIndexNamePrefix, getInOutputProcedureToken, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxIndexNameSize, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getPartitioningCallback, getPingSQL, getProcedureArgumentSetter, getProcedureArgumentString, getProcedureCallTail, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, getTransactionIsolation, getTypeConverters, getUniqueConstraintDeletionString, getUseNationalCharacterVaryingTypeForString, getVPDClearIdentifierQuery, getVPDCreationFunctionString, getVPDCreationPolicyString, getVPDDeletionString, getVPDSetIdentifierQuery, hasPartitioningCallback, initialize, isCastRequired, isForUpdateCompatibleWithDistinct, isInformixOuterJoin, isJDBCExecuteCompliant, isLobCompatibleWithDistinct, isLockTimeoutException, isOutputAllowWithResultSet, isRowCountOutputParameterRequired, isXDBDocument, minimumTimeIncrement, prepareBatchStatement, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldUnique, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTableInIndexDropDDL, requiresTypeNameToRegisterOutputParameter, requiresUniqueConstraintCreationOnTableCreate, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setBatchWritingMechanism, setCastSizeForVarcharParameter, setCursorCode, setDriverName, setDriverSupportsNVarChar, setIsCastRequired, setMaxBatchWritingSize, setParameterValueInDatabaseCall, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldCreateIndicesOnForeignKeys, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStoredProcedureTerminationToken, setStringBindingSize, setSupportsAutoCommit, setTableCreationSuffix, setTransactionIsolation, setUseJDBCStoredProcedureSyntax, setUseNationalCharacterVaryingTypeForString, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsIndexes, supportsIndividualTableLocking, supportsLocalTempTables, supportsNestingOuterJoins, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, supportsVPD, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeAddColumnClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeInsertIntoTableSql, writeLOB, writeTableCreationSuffix, writeUpdateOriginalFromTempTableSqladdSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, clone, convertObject, createConnectionCustomizer, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, isAccess, isAttunity, isCloudscape, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMaxDB, isMySQL, isODBC, isOracle, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsNativeSequenceNumbers, toString, usesPlatformDefaultSequencepublic void initializeConnectionData(java.sql.Connection connection)
throws java.sql.SQLException
DatabasePlatforminitializeConnectionData in class DatabasePlatformjava.sql.SQLExceptionpublic int getMaxFieldNameSize()
getMaxFieldNameSize in class DatabasePlatformpublic int getMaxForeignKeyNameSize()
getMaxForeignKeyNameSize in class DatabasePlatformpublic int getMaxUniqueKeyNameSize()
getMaxUniqueKeyNameSize in class DatabasePlatformpublic java.util.Vector getNativeTableInfo(java.lang.String table,
java.lang.String creator,
AbstractSession session)
public java.lang.String getProcedureCallHeader()
getProcedureCallHeader in class DatabasePlatformpublic java.lang.String getSelectForUpdateString()
getSelectForUpdateString in class DatabasePlatformpublic java.lang.String getProcedureEndString()
getProcedureEndString in class DatabasePlatformpublic java.lang.String getProcedureBeginString()
getProcedureBeginString in class DatabasePlatformpublic java.lang.String getProcedureAsString()
getProcedureAsString in class DatabasePlatformpublic boolean shouldPrintOutputTokenAtStart()
shouldPrintOutputTokenAtStart in class DatabasePlatformpublic ValueReadQuery getTimestampQuery()
getTimestampQuery in interface PlatformgetTimestampQuery in class DatasourcePlatformpublic boolean isDB2()
isDB2 in interface PlatformisDB2 in class DatasourcePlatformpublic java.util.Hashtable maximumNumericValues()
NOTE: BigInteger & BigDecimal maximums are dependent upon their precision & Scale
maximumNumericValues in class DatabasePlatformpublic java.util.Hashtable minimumNumericValues()
NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
minimumNumericValues in class DatabasePlatformpublic boolean shouldIgnoreException(java.sql.SQLException exception)
shouldIgnoreException in class DatabasePlatformpublic boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax in class DatabasePlatformpublic ValueReadQuery buildSelectQueryForIdentity()
buildSelectQueryForIdentity in class DatasourcePlatformpublic void printFieldIdentityClause(java.io.Writer writer)
throws ValidationException
printFieldIdentityClause in class DatabasePlatformValidationExceptionpublic boolean supportsIdentity()
supportsIdentity in class DatasourcePlatformpublic boolean supportsGlobalTempTables()
supportsGlobalTempTables in class DatabasePlatformpublic DatabaseTable getTempTableForTable(DatabaseTable table)
getTempTableForTable in class DatabasePlatformpublic boolean dontBindUpdateAllQueryUsingTempTables()
dontBindUpdateAllQueryUsingTempTables in class DatabasePlatformpublic boolean isNullAllowedInSelectClause()
isNullAllowedInSelectClause in class DatabasePlatformpublic boolean isDynamicSQLRequiredForFunctions()
isDynamicSQLRequiredForFunctions in class DatabasePlatformpublic void writeParameterMarker(java.io.Writer writer,
ParameterExpression parameter,
AbstractRecord record,
DatabaseCall call)
throws java.io.IOException
writeParameterMarker in class DatabasePlatformjava.io.IOExceptionpublic boolean supportsLockingQueriesWithMultipleTables()
supportsLockingQueriesWithMultipleTables in class DatabasePlatformpublic ValueReadQuery buildSelectQueryForSequenceObject(java.lang.String seqName, java.lang.Integer size)
buildSelectQueryForSequenceObject in class DatasourcePlatformpublic boolean supportsSequenceObjects()
supportsSequenceObjects in class DatasourcePlatformpublic boolean isAlterSequenceObjectSupported()
isAlterSequenceObjectSupported in class DatabasePlatformpublic boolean shouldPrintForUpdateClause()
shouldPrintForUpdateClause in class DatabasePlatformpublic void printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement)
printSQLSelectStatement in class DatabasePlatformEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference