public class DB2Platform extends DatabasePlatform
Purpose: Provides DB2 specific behaviour.
Responsibilities:
classTypes, cursorCode, fieldTypes, shouldBindAllParameters, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldTrimStrings, statementCacheSize, stringBindingSize, supportsAutoCommit, transactionIsolation, usesByteArrayBinding, usesNativeSQL, usesStreamsForBinding, usesStringBindingconversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultSequence, platformOperators, sequences, tableQualifier, timestampQuery| Constructor and Description |
|---|
DB2Platform() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendByteArray(byte[] bytes,
java.io.Writer writer)
INTERNAL:
Append a byte[] in native DB@ format BLOB(hexString) if usesNativeSQL(),
otherwise use ODBC format from DatabasePLatform.
|
protected void |
appendCalendar(java.util.Calendar calendar,
java.io.Writer writer)
INTERNAL:
Append the Timestamp in native format if usesNativeSQL() is true otherwise use ODBC format from DatabasePlatform.
|
protected void |
appendDate(java.sql.Date date,
java.io.Writer writer)
INTERNAL:
Appends the Date in native format if usesNativeSQL() otherwise use ODBC format from DatabasePlatform.
|
protected void |
appendDB2Calendar(java.util.Calendar calendar,
java.io.Writer writer)
INTERNAL:
Write a timestamp in DB2 specific format (yyyy-mm-dd-hh.mm.ss.ffffff).
|
protected void |
appendDB2Date(java.sql.Date date,
java.io.Writer writer)
INTERNAL:
Write a timestamp in DB2 specific format (mm/dd/yyyy).
|
protected void |
appendDB2Timestamp(java.sql.Timestamp timestamp,
java.io.Writer writer)
INTERNAL:
Write a timestamp in DB2 specific format (yyyy-mm-dd-hh.mm.ss.ffffff).
|
protected void |
appendTime(java.sql.Time time,
java.io.Writer writer)
INTERNAL:
Append the Time in Native format if usesNativeSQL() otherwise use ODBC format from DAtabasePlatform.
|
protected void |
appendTimestamp(java.sql.Timestamp timestamp,
java.io.Writer writer)
INTERNAL:
Append the Timestamp in native format if usesNativeSQL() is true otherwise use ODBC format from DatabasePlatform.
|
protected java.util.Hashtable |
buildFieldTypes()
Return the mapping of class types to database types for the schema framework.
|
ValueReadQuery |
buildSelectQueryForNativeSequence()
INTERNAL:
Build the identity query for native sequencing.
|
protected java.lang.String |
getCreateTempTableSqlBodyForTable(DatabaseTable table)
INTERNAL:
|
protected java.lang.String |
getCreateTempTableSqlPrefix()
INTERNAL:
|
protected java.lang.String |
getCreateTempTableSqlSuffix()
INTERNAL:
|
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.
|
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()
INTERNAL:
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:
|
DatabaseTable |
getTempTableForTable(DatabaseTable table)
INTERNAL:
|
ValueReadQuery |
getTimestampQuery()
INTERNAL:
This method returns the query to select the timestamp
from the server for DB2.
|
protected void |
initializePlatformOperators()
INTERNAL:
Initialize any platform-specific operators
|
boolean |
isDB2() |
boolean |
isNullAllowedInSelectClause()
INTERNAL:
Override this if the platform cannot handle 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
|
boolean |
shouldBindLiterals()
INTERNAL
Allows platform to choose whether to bind literals in DatabaseCalls or not.
|
boolean |
shouldIgnoreException(java.sql.SQLException exception)
INTERNAL:
Allow for the platform to ignore exceptions.
|
boolean |
shouldNativeSequenceAcquireValueAfterInsert()
INTERNAL:
If native sequencing is being used on DB2 then the values must be
retrieved after the insert.
|
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:
|
boolean |
supportsNativeSequenceNumbers()
Return true if the receiver uses host sequence numbers, generated on the database.
|
void |
writeParameterMarker(java.io.Writer writer,
ParameterExpression parameter) |
allowsSizeInProcedureArguments, appendBoolean, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, autoCommit, beginTransaction, buildCallWithReturning, buildClassTypes, buildSelectQueryForNativeSequence, canBuildCallWithReturning, commitTransaction, convertToDatabaseType, copyInto, createPlatformDefaultSequence, dontBindUpdateAllQueryUsingTempTables, executeStoredProcedure, getAssignmentString, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getClassTypes, getConstraintDeletionString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getInOutputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJdbcTypeName, getMaxUniqueKeyNameSize, getObjectFromResultSet, getOutputProcedureToken, getProcedureArgumentSetter, getProcedureArgumentString, getProcedureCallTail, getQualifiedSequenceTableName, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getTransactionIsolation, isInformixOuterJoin, printFieldIdentityClause, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldUnique, printValuelist, printValuelist, processResultSet, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTypeNameToRegisterOutputParameter, rollbackTransaction, setClassTypes, setCursorCode, setFieldTypes, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setPrimitiveParameterValue, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldCacheAllStatements, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTransactionIsolation, setUsesByteArrayBinding, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAcquireSequenceValueAfterInsert, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldNativeSequenceUseTransaction, shouldOptimizeDataConversion, shouldPrintConstraintNameAfter, shouldPrintInOutputTokenBeforeType, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenBeforeType, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, supportsAutoCommit, supportsForeignKeyConstraints, supportsLocalTempTables, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueKeyConstraints, usesByteArrayBinding, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeUpdateOriginalFromTempTableSqladdOperator, addSequence, clone, convertObject, createSequences, getConversionManager, getCustomModifyValueForCall, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultSequence, getDefaultSequenceToWrite, getOperator, getPlatformOperators, getSequence, getSequences, getSequencesToWrite, getTableQualifier, getTimestampFromServer, hasDefaultSequence, isAccess, isAttunity, isCloudscape, isDBase, isDerby, isHSQL, isInformix, isMySQL, isODBC, isOracle, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isTimesTen, platformSpecificSequencingInitialization, removeAllSequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultSequence, setSequences, setTableQualifier, setTimestampQuery, shouldUseCustomModifyForCall, toString, usesPlatformDefaultSequenceprotected void appendByteArray(byte[] bytes,
java.io.Writer writer)
throws java.io.IOException
appendByteArray in class DatabasePlatformjava.io.IOExceptionprotected void appendDate(java.sql.Date date,
java.io.Writer writer)
throws java.io.IOException
appendDate in class DatabasePlatformjava.io.IOExceptionprotected void appendDB2Date(java.sql.Date date,
java.io.Writer writer)
throws java.io.IOException
java.io.IOExceptionprotected void appendDB2Timestamp(java.sql.Timestamp timestamp,
java.io.Writer writer)
throws java.io.IOException
java.io.IOExceptionprotected void appendDB2Calendar(java.util.Calendar calendar,
java.io.Writer writer)
throws java.io.IOException
java.io.IOExceptionprotected void appendTime(java.sql.Time time,
java.io.Writer writer)
throws java.io.IOException
appendTime in class DatabasePlatformjava.io.IOExceptionprotected void appendTimestamp(java.sql.Timestamp timestamp,
java.io.Writer writer)
throws java.io.IOException
appendTimestamp in class DatabasePlatformjava.io.IOExceptionprotected void appendCalendar(java.util.Calendar calendar,
java.io.Writer writer)
throws java.io.IOException
appendCalendar in class DatabasePlatformjava.io.IOExceptionprotected java.util.Hashtable buildFieldTypes()
DatabasePlatformbuildFieldTypes in class DatabasePlatformpublic int getMaxFieldNameSize()
getMaxFieldNameSize in class DatabasePlatformpublic int getMaxForeignKeyNameSize()
getMaxForeignKeyNameSize 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 DatasourcePlatformprotected void initializePlatformOperators()
initializePlatformOperators 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 buildSelectQueryForNativeSequence()
buildSelectQueryForNativeSequence in class DatabasePlatformpublic void printFieldIdentityClause(java.io.Writer writer)
throws ValidationException
printFieldIdentityClause in class DatabasePlatformValidationExceptionpublic boolean shouldNativeSequenceAcquireValueAfterInsert()
shouldNativeSequenceAcquireValueAfterInsert in class DatabasePlatformpublic boolean supportsNativeSequenceNumbers()
supportsNativeSequenceNumbers in class DatabasePlatformpublic boolean supportsGlobalTempTables()
supportsGlobalTempTables in class DatabasePlatformprotected java.lang.String getCreateTempTableSqlPrefix()
getCreateTempTableSqlPrefix in class DatabasePlatformpublic DatabaseTable getTempTableForTable(DatabaseTable table)
getTempTableForTable in class DatabasePlatformprotected java.lang.String getCreateTempTableSqlSuffix()
getCreateTempTableSqlSuffix in class DatabasePlatformprotected java.lang.String getCreateTempTableSqlBodyForTable(DatabaseTable table)
getCreateTempTableSqlBodyForTable in class DatabasePlatformpublic boolean isNullAllowedInSelectClause()
isNullAllowedInSelectClause in class DatabasePlatformpublic void writeParameterMarker(java.io.Writer writer,
ParameterExpression parameter)
throws java.io.IOException
writeParameterMarker in class DatabasePlatformjava.io.IOExceptionpublic boolean shouldBindLiterals()
shouldBindLiterals in class DatabasePlatform