public class DB2Platform extends DatabasePlatform
Purpose: Provides DB2 specific behavior.
Responsibilities:
DEFAULT_VARCHAR_SIZE| Constructor and Description |
|---|
DB2Platform() |
| Modifier and Type | Method and Description |
|---|---|
ValueReadQuery |
buildSelectQueryForIdentity()
INTERNAL: Build the identity query for native sequencing.
|
ValueReadQuery |
buildSelectQueryForSequenceObject(String seqName,
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.
|
Vector |
getNativeTableInfo(String table,
String creator,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Return the catalog information through using the native SQL catalog
selects.
|
String |
getProcedureAsString()
INTERNAL:
Used for stored procedure defs.
|
String |
getProcedureBeginString()
Used for stored procedure defs.
|
String |
getProcedureCallHeader()
INTERNAL:
Used for sp calls.
|
String |
getProcedureEndString()
INTERNAL:
Used for stored procedure defs.
|
String |
getSelectForUpdateString()
INTERNAL:
Used for pessimistic locking in DB2.
|
org.eclipse.persistence.internal.helper.DatabaseTable |
getTempTableForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: DB2 temp table syntax.
|
ValueReadQuery |
getTimestampQuery()
INTERNAL:
This method returns the query to select the timestamp from the server for
DB2.
|
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.
|
Hashtable |
maximumNumericValues()
INTERNAL:
Builds a table of maximum numeric values keyed on java class.
|
Hashtable |
minimumNumericValues()
INTERNAL:
Builds a table of minimum numeric values keyed on java class.
|
void |
printFieldIdentityClause(Writer writer)
INTERNAL: Append the receiver's field 'identity' constraint clause to a
writer.
|
void |
printSQLSelectStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call,
org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter printer,
org.eclipse.persistence.internal.expressions.SQLSelectStatement statement)
INTERNAL:
Print the SQL representation of the statement on a stream, storing the fields
in the DatabaseCall.
|
boolean |
shouldIgnoreException(SQLException exception)
INTERNAL:
Allow for the platform to ignore exceptions.
|
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(Writer writer,
org.eclipse.persistence.internal.expressions.ParameterExpression parameter,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.databaseaccess.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, buildCallWithReturning, buildCreateIndex, buildDropIndex, buildProcedureCallString, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, canBuildCallWithReturning, commitTransaction, computeMaxRowsForSQL, convertToDatabaseType, copyInto, createArray, createArray, createStruct, createStruct, executeBatch, executeStoredProcedure, freeTemporaryObject, getAssignmentString, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConstraintDeletionString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIdentifierQuoteCharacter, getInOutputProcedureToken, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJdbcTypeName, getMaxBatchWritingSize, getMaxIndexNameSize, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getPingSQL, getProcedureArgumentSetter, getProcedureArgumentString, getProcedureCallTail, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTransactionIsolation, getTypeConverters, initialize, isCastRequired, isForUpdateCompatibleWithDistinct, isInformixOuterJoin, isLockTimeoutException, isXDBDocument, prepareBatchStatement, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldUnique, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTypeNameToRegisterOutputParameter, requiresUniqueConstraintCreationOnTableCreate, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setCastSizeForVarcharParameter, setCursorCode, setIsCastRequired, setMaxBatchWritingSize, setParameterValueInDatabaseCall, setPingSQL, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTransactionIsolation, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnUniqueKeys, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldNativeSequenceUseTransaction, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsForeignKeyConstraints, supportsIndividualTableLocking, supportsLocalTempTables, supportsNativeSequenceNumbers, supportsNestingOuterJoins, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeInsertIntoTableSql, writeLOB, writeUpdateOriginalFromTempTableSqladdSequence, clone, convertObject, createConnectionCustomizer, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, isAccess, isAttunity, isCloudscape, isDBase, isDerby, isFirebird, isH2, isHSQL, isInformix, isMySQL, isODBC, isOracle, isOracle9, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, setConversionManager, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, toString, usesPlatformDefaultSequencepublic int getMaxFieldNameSize()
getMaxFieldNameSize in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic int getMaxForeignKeyNameSize()
getMaxForeignKeyNameSize in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic int getMaxUniqueKeyNameSize()
getMaxUniqueKeyNameSize in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic Vector getNativeTableInfo(String table, String creator, org.eclipse.persistence.internal.sessions.AbstractSession session)
public String getProcedureCallHeader()
getProcedureCallHeader in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic String getSelectForUpdateString()
getSelectForUpdateString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic String getProcedureEndString()
getProcedureEndString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic String getProcedureBeginString()
getProcedureBeginString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic String getProcedureAsString()
getProcedureAsString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean shouldPrintOutputTokenAtStart()
shouldPrintOutputTokenAtStart in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic ValueReadQuery getTimestampQuery()
getTimestampQuery in interface org.eclipse.persistence.internal.databaseaccess.PlatformgetTimestampQuery in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatformpublic boolean isDB2()
isDB2 in interface org.eclipse.persistence.internal.databaseaccess.PlatformisDB2 in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatformpublic Hashtable maximumNumericValues()
NOTE: BigInteger & BigDecimal maximums are dependent upon their precision & Scale
maximumNumericValues in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic Hashtable minimumNumericValues()
NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
minimumNumericValues in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean shouldIgnoreException(SQLException exception)
shouldIgnoreException in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic ValueReadQuery buildSelectQueryForIdentity()
buildSelectQueryForIdentity in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic void printFieldIdentityClause(Writer writer) throws ValidationException
printFieldIdentityClause in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformValidationExceptionpublic boolean supportsIdentity()
supportsIdentity in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean supportsGlobalTempTables()
supportsGlobalTempTables in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic org.eclipse.persistence.internal.helper.DatabaseTable getTempTableForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
getTempTableForTable in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean dontBindUpdateAllQueryUsingTempTables()
dontBindUpdateAllQueryUsingTempTables in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean isNullAllowedInSelectClause()
isNullAllowedInSelectClause in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean isDynamicSQLRequiredForFunctions()
isDynamicSQLRequiredForFunctions in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic void writeParameterMarker(Writer writer, org.eclipse.persistence.internal.expressions.ParameterExpression parameter, org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.databaseaccess.DatabaseCall call) throws IOException
writeParameterMarker in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformIOExceptionpublic boolean supportsLockingQueriesWithMultipleTables()
supportsLockingQueriesWithMultipleTables in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic ValueReadQuery buildSelectQueryForSequenceObject(String seqName, Integer size)
buildSelectQueryForSequenceObject in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean supportsSequenceObjects()
supportsSequenceObjects in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean isAlterSequenceObjectSupported()
isAlterSequenceObjectSupported in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic void printSQLSelectStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call,
org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter printer,
org.eclipse.persistence.internal.expressions.SQLSelectStatement statement)
printSQLSelectStatement in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform