public class DerbyPlatform extends DB2Platform
Purpose: Provides Derby DBMS specific behavior.
Modifier and Type | Field and Description |
---|---|
protected boolean |
isConnectionDataInitialized |
protected boolean |
isSequenceSupported
Allow sequence support to be disabled for Derby < 10.6.1.
|
static int |
MAX_BLOB |
static int |
MAX_CLOB |
DEFAULT_VARCHAR_SIZE
batchWritingMechanism, castSizeForVarcharParameter, classTypes, cursorCode, DEFAULT_MAX_BATCH_WRITING_SIZE, DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE, driverName, driverSupportsNationalCharacterVarying, fieldTypes, IS_VALID_TIMEOUT, isCastRequired, maxBatchWritingSize, partitioningCallback, pingSQL, printInnerJoinInWhereClause, printOuterJoinInWhereClause, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesOnForeignKeys, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldTrimStrings, statementCacheSize, storedProcedureTerminationToken, stringBindingSize, structConverters, supportsAutoCommit, tableCreationSuffix, transactionIsolation, typeConverters, useJDBCStoredProcedureSyntax, useNationalCharacterVarying, useRownumFiltering, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesStreamsForBinding, usesStringBinding
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultNativeSequenceToTable, defaultSeqenceAtNextValue, defaultSequence, endDelimiter, platformOperators, sequences, sequencesLock, startDelimiter, tableQualifier, timestampQuery
Constructor and Description |
---|
DerbyPlatform() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendByteArray(byte[] bytes,
Writer writer)
INTERNAL:
TODO: Need to find out how can byte arrays be inlined in Derby
|
protected Hashtable |
buildFieldTypes()
Return the mapping of class types to database types for the schema framework.
|
ValueReadQuery |
buildSelectQueryForIdentity()
INTERNAL:
Build the identity query for native sequencing.
|
Writer |
buildSequenceObjectDeletionWriter(Writer writer,
String fullSeqName)
INTERNAL: Derby supports sequence objects as of 10.6.1.
|
int |
computeMaxRowsForSQL(int firstResultIndex,
int maxResults)
INTERNAL:
Use the JDBC maxResults and firstResultIndex setting to compute a value to use when
limiting the results of a query in SQL.
|
Object |
convertToDatabaseType(Object value)
Derby error the data type, length or value of arguments 'TIMESTAMP' and 'DATE' is incompatible.
|
static ExpressionOperator |
extractOperator()
INTERNAL:
Derby does not support EXTRACT, but does have YEAR, MONTH, DAY, etc.
|
protected String |
getCreateTempTableSqlBodyForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL:
|
protected String |
getCreateTempTableSqlSuffix()
INTERNAL:
|
String |
getInOutputProcedureToken()
This method is used to print the output parameter token when stored
procedures are called
|
Vector |
getNativeTableInfo(String table,
String creator,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Not currently used.
|
String |
getProcedureBeginString()
Used for stored procedure defs.
|
String |
getProcedureEndString()
Used for stored procedure defs.
|
String |
getSelectForUpdateString()
INTERNAL:
Used for pessimistic locking in DB2.
|
ValueReadQuery |
getTimestampQuery()
INTERNAL:
This method returns the query to select the timestamp from the server
for Derby.
|
void |
initializeConnectionData(Connection connection)
INTERNAL:
|
protected void |
initializePlatformOperators()
Initialize any platform-specific operators
|
boolean |
isAlterSequenceObjectSupported()
INTERNAL: DB2 added SEQUENCE support as of (I believe) v8.
|
boolean |
isDB2() |
boolean |
isDerby()
INTERNAL:
Answers whether platform is Derby
|
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.
|
protected void |
setNullFromDatabaseField(org.eclipse.persistence.internal.helper.DatabaseField databaseField,
PreparedStatement statement,
int index) |
boolean |
shouldIgnoreException(SQLException exception)
Allow for the platform to ignore exceptions.
|
boolean |
shouldPrintOutputTokenAtStart()
This is required in the construction of the stored procedures with
output parameters
|
protected boolean |
shouldTempTableSpecifyPrimaryKeys()
INTERNAL:
Indicates whether temporary table can specify primary keys (some platforms don't allow that).
|
boolean |
supportsSequenceObjects()
INTERNAL: Derby supports sequence objects as of 10.6.1.
|
void |
writeUpdateOriginalFromTempTableSql(Writer writer,
org.eclipse.persistence.internal.helper.DatabaseTable table,
Collection pkFields,
Collection assignedFields)
INTERNAL:
May need to override this method if the platform supports temporary tables
and the generated sql doesn't work.
|
appendCalendar, appendDate, appendDB2Calendar, appendDB2Date, appendDB2Timestamp, appendTime, appendTimestamp, buildSelectQueryForSequenceObject, dontBindUpdateAllQueryUsingTempTables, getCreateTempTableSqlPrefix, getMaxFieldNameSize, getMaxForeignKeyNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getProcedureArgument, getProcedureAsString, getProcedureCallHeader, getTempTableForTable, isDynamicSQLRequiredForFunctions, isNullAllowedInSelectClause, maximumNumericValues, minimumNumericValues, printFieldTypeSize, shouldPrintForUpdateClause, shouldUseJDBCOuterJoinSyntax, supportsGlobalTempTables, supportsIdentity, supportsLockingQueriesWithMultipleTables, writeParameterMarker
addBatch, addStructConverter, allowsSizeInProcedureArguments, appendBoolean, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCallWithReturning, buildClassTypes, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, canBatchWriteWithOptimisticLocking, canBuildCallWithReturning, checkTableExists, commitTransaction, copyInto, createArray, createArray, createPlatformDefaultSequence, 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, getIndexNamePrefix, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxIndexNameSize, getObjectFromResultSet, getOutputProcedureToken, getParameterValueFromDatabaseCall, getParameterValueFromDatabaseCall, getPartitioningCallback, getPingSQL, getProcedureArgumentString, getProcedureCallTail, getProcedureOptionList, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, getTableExistsQuery, 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, printFieldUnique, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, registerOutputParameter, registerOutputParameter, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTableInIndexDropDDL, requiresTypeNameToRegisterOutputParameter, requiresUniqueConstraintCreationOnTableCreate, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setBatchWritingMechanism, setCastSizeForVarcharParameter, setClassTypes, setCursorCode, setDriverName, setDriverSupportsNVarChar, setFieldTypes, setIsCastRequired, setMaxBatchWritingSize, setNullFromDatabaseField, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldCreateIndicesOnForeignKeys, setShouldForceBindAllParameters, 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, shouldForceBindAllParameters, 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, supportsWaitForUpdate, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeAddColumnClause, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeTableCreationSuffix
addOperator, addSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, clone, convertObject, createConnectionCustomizer, createExpressionFor, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSeqenceAtNextValue, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getINClauseLimit, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, initIdentitySequences, isAccess, isAttunity, isCloudscape, isDB2Z, isDBase, isFirebird, isH2, isHANA, isHSQL, isInformix, isMaxDB, isMySQL, isODBC, isOracle, isOracle12, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeIdentitySequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSeqenceAtNextValue, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsNativeSequenceNumbers, toString, usesPlatformDefaultSequence
public static final int MAX_CLOB
public static final int MAX_BLOB
protected boolean isSequenceSupported
protected boolean isConnectionDataInitialized
protected void appendByteArray(byte[] bytes, Writer writer) throws IOException
appendByteArray
in class DB2Platform
IOException
public Object convertToDatabaseType(Object value)
convertToDatabaseType
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public ValueReadQuery getTimestampQuery()
getTimestampQuery
in interface org.eclipse.persistence.internal.databaseaccess.Platform
getTimestampQuery
in class DB2Platform
public Vector getNativeTableInfo(String table, String creator, org.eclipse.persistence.internal.sessions.AbstractSession session)
getNativeTableInfo
in class DB2Platform
public String getProcedureEndString()
getProcedureEndString
in class DB2Platform
public String getProcedureBeginString()
getProcedureBeginString
in class DB2Platform
public String getInOutputProcedureToken()
getInOutputProcedureToken
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public boolean shouldPrintOutputTokenAtStart()
shouldPrintOutputTokenAtStart
in class DB2Platform
public boolean isDerby()
isDerby
in interface org.eclipse.persistence.internal.databaseaccess.Platform
isDerby
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public boolean isDB2()
isDB2
in interface org.eclipse.persistence.internal.databaseaccess.Platform
isDB2
in class DB2Platform
public String getSelectForUpdateString()
DB2Platform
getSelectForUpdateString
in class DB2Platform
public boolean shouldIgnoreException(SQLException exception)
shouldIgnoreException
in class DB2Platform
protected String getCreateTempTableSqlSuffix()
getCreateTempTableSqlSuffix
in class DB2Platform
public ValueReadQuery buildSelectQueryForIdentity()
buildSelectQueryForIdentity
in class DB2Platform
protected boolean shouldTempTableSpecifyPrimaryKeys()
shouldTempTableSpecifyPrimaryKeys
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
protected String getCreateTempTableSqlBodyForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
getCreateTempTableSqlBodyForTable
in class DB2Platform
table
- is original table for which temp table is created.public void writeUpdateOriginalFromTempTableSql(Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, Collection pkFields, Collection assignedFields) throws IOException
writeUpdateOriginalFromTempTableSql
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
writer
- for writing the sqltable
- is original table for which temp table is created.pkFields
- - primary key fields for the original table.assignedFields
- - fields to be assigned a new value.IOException
public void printFieldIdentityClause(Writer writer) throws ValidationException
printFieldIdentityClause
in class DB2Platform
ValidationException
protected Hashtable buildFieldTypes()
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
buildFieldTypes
in class DB2Platform
protected void setNullFromDatabaseField(org.eclipse.persistence.internal.helper.DatabaseField databaseField, PreparedStatement statement, int index) throws SQLException
setNullFromDatabaseField
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
SQLException
protected void initializePlatformOperators()
initializePlatformOperators
in class DB2Platform
public static ExpressionOperator extractOperator()
public int computeMaxRowsForSQL(int firstResultIndex, int maxResults)
computeMaxRowsForSQL
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
MySQLPlatform
public 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 DB2Platform
public boolean supportsSequenceObjects()
supportsSequenceObjects
in class DB2Platform
public boolean isAlterSequenceObjectSupported()
DB2Platform
isAlterSequenceObjectSupported
in class DB2Platform
public Writer buildSequenceObjectDeletionWriter(Writer writer, String fullSeqName) throws IOException
buildSequenceObjectDeletionWriter
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
IOException
public void initializeConnectionData(Connection connection) throws SQLException
initializeConnectionData
in class DB2Platform
SQLException
Copyright © 2007–2020 Eclipse.org - EclipseLink Project. All rights reserved.