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, usesStringBinding
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultSequence, platformOperators, sequences, tableQualifier, timestampQuery
Constructor and Description |
---|
DB2Platform() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendByteArray(byte[] bytes,
Writer writer)
INTERNAL:
Append a byte[] in native DB@ format BLOB(hexString) if usesNativeSQL(),
otherwise use ODBC format from DatabasePLatform.
|
protected void |
appendCalendar(Calendar calendar,
Writer writer)
INTERNAL:
Append the Timestamp in native format if usesNativeSQL() is true otherwise use ODBC format from DatabasePlatform.
|
protected void |
appendDate(Date date,
Writer writer)
INTERNAL:
Appends the Date in native format if usesNativeSQL() otherwise use ODBC format from DatabasePlatform.
|
protected void |
appendDB2Calendar(Calendar calendar,
Writer writer)
INTERNAL:
Write a timestamp in DB2 specific format (yyyy-mm-dd-hh.mm.ss.ffffff).
|
protected void |
appendDB2Date(Date date,
Writer writer)
INTERNAL:
Write a timestamp in DB2 specific format (mm/dd/yyyy).
|
protected void |
appendDB2Timestamp(Timestamp timestamp,
Writer writer)
INTERNAL:
Write a timestamp in DB2 specific format (yyyy-mm-dd-hh.mm.ss.ffffff).
|
protected void |
appendTime(Time time,
Writer writer)
INTERNAL:
Append the Time in Native format if usesNativeSQL() otherwise use ODBC format from DAtabasePlatform.
|
protected void |
appendTimestamp(Timestamp timestamp,
Writer writer)
INTERNAL:
Append the Timestamp in native format if usesNativeSQL() is true otherwise use ODBC format from DatabasePlatform.
|
protected 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 String |
getCreateTempTableSqlBodyForTable(DatabaseTable table)
INTERNAL:
|
protected String |
getCreateTempTableSqlPrefix()
INTERNAL:
|
protected 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.
|
Vector |
getNativeTableInfo(String table,
String creator,
AbstractSession session)
INTERNAL:
Return the catalog information through using the native SQL catalog selects.
|
String |
getProcedureAsString()
INTERNAL:
Used for stored procedure defs.
|
String |
getProcedureBeginString()
INTERNAL:
Used for stored procedure defs.
|
String |
getProcedureCallHeader()
INTERNAL:
Used for sp calls.
|
String |
getProcedureEndString()
INTERNAL:
Used for stored procedure defs.
|
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.
|
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
|
boolean |
shouldBindLiterals()
INTERNAL
Allows platform to choose whether to bind literals in DatabaseCalls or not.
|
boolean |
shouldIgnoreException(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(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, writeUpdateOriginalFromTempTableSql
addOperator, 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, usesPlatformDefaultSequence
protected void appendByteArray(byte[] bytes, Writer writer) throws IOException
appendByteArray
in class DatabasePlatform
IOException
protected void appendDate(Date date, Writer writer) throws IOException
appendDate
in class DatabasePlatform
IOException
protected void appendDB2Date(Date date, Writer writer) throws IOException
IOException
protected void appendDB2Timestamp(Timestamp timestamp, Writer writer) throws IOException
IOException
protected void appendDB2Calendar(Calendar calendar, Writer writer) throws IOException
IOException
protected void appendTime(Time time, Writer writer) throws IOException
appendTime
in class DatabasePlatform
IOException
protected void appendTimestamp(Timestamp timestamp, Writer writer) throws IOException
appendTimestamp
in class DatabasePlatform
IOException
protected void appendCalendar(Calendar calendar, Writer writer) throws IOException
appendCalendar
in class DatabasePlatform
IOException
protected Hashtable buildFieldTypes()
DatabasePlatform
buildFieldTypes
in class DatabasePlatform
public int getMaxFieldNameSize()
getMaxFieldNameSize
in class DatabasePlatform
public int getMaxForeignKeyNameSize()
getMaxForeignKeyNameSize
in class DatabasePlatform
public Vector getNativeTableInfo(String table, String creator, AbstractSession session)
public String getProcedureCallHeader()
getProcedureCallHeader
in class DatabasePlatform
public String getSelectForUpdateString()
getSelectForUpdateString
in class DatabasePlatform
public String getProcedureEndString()
getProcedureEndString
in class DatabasePlatform
public String getProcedureBeginString()
getProcedureBeginString
in class DatabasePlatform
public String getProcedureAsString()
getProcedureAsString
in class DatabasePlatform
public boolean shouldPrintOutputTokenAtStart()
shouldPrintOutputTokenAtStart
in class DatabasePlatform
public ValueReadQuery getTimestampQuery()
getTimestampQuery
in interface Platform
getTimestampQuery
in class DatasourcePlatform
protected void initializePlatformOperators()
initializePlatformOperators
in class DatasourcePlatform
public boolean isDB2()
isDB2
in interface Platform
isDB2
in class DatasourcePlatform
public Hashtable maximumNumericValues()
NOTE: BigInteger & BigDecimal maximums are dependent upon their precision & Scale
maximumNumericValues
in class DatabasePlatform
public Hashtable minimumNumericValues()
NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
minimumNumericValues
in class DatabasePlatform
public boolean shouldIgnoreException(SQLException exception)
shouldIgnoreException
in class DatabasePlatform
public boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax
in class DatabasePlatform
public ValueReadQuery buildSelectQueryForNativeSequence()
buildSelectQueryForNativeSequence
in class DatabasePlatform
public void printFieldIdentityClause(Writer writer) throws ValidationException
printFieldIdentityClause
in class DatabasePlatform
ValidationException
public boolean shouldNativeSequenceAcquireValueAfterInsert()
shouldNativeSequenceAcquireValueAfterInsert
in class DatabasePlatform
public boolean supportsNativeSequenceNumbers()
supportsNativeSequenceNumbers
in class DatabasePlatform
public boolean supportsGlobalTempTables()
supportsGlobalTempTables
in class DatabasePlatform
protected String getCreateTempTableSqlPrefix()
getCreateTempTableSqlPrefix
in class DatabasePlatform
public DatabaseTable getTempTableForTable(DatabaseTable table)
getTempTableForTable
in class DatabasePlatform
protected String getCreateTempTableSqlSuffix()
getCreateTempTableSqlSuffix
in class DatabasePlatform
protected String getCreateTempTableSqlBodyForTable(DatabaseTable table)
getCreateTempTableSqlBodyForTable
in class DatabasePlatform
public boolean isNullAllowedInSelectClause()
isNullAllowedInSelectClause
in class DatabasePlatform
public void writeParameterMarker(Writer writer, ParameterExpression parameter) throws IOException
writeParameterMarker
in class DatabasePlatform
IOException
public boolean shouldBindLiterals()
shouldBindLiterals
in class DatabasePlatform
Copyright © 2022. All rights reserved.