Module org.eclipse.persistence.core
Class SybasePlatform
- java.lang.Object
-
- org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
- org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
- org.eclipse.persistence.platform.database.DatabasePlatform
-
- org.eclipse.persistence.platform.database.SybasePlatform
-
- All Implemented Interfaces:
Serializable,Cloneable,CorePlatform<ConversionManager>,Platform
- Direct Known Subclasses:
SQLAnywherePlatform
public class SybasePlatform extends DatabasePlatform
Purpose: Provides Sybase ASE specific behavior.
Responsibilities:
- Native SQL for byte[], Date, Time, & Timestamp.
- Native sequencing using @@IDENTITY.
- Since:
- TOPLink/Java 1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Integer,String>typeStrings-
Fields inherited from class org.eclipse.persistence.platform.database.DatabasePlatform
DEFAULT_VARCHAR_SIZE
-
Fields inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
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, shouldBindPartialParameters, 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
-
Fields inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultNativeSequenceToTable, defaultSeqenceAtNextValue, defaultSequence, endDelimiter, platformOperators, sequences, sequencesLock, startDelimiter, supportsReturnGeneratedKeys, tableQualifier, timestampQuery, uuidQuery
-
-
Constructor Summary
Constructors Constructor Description SybasePlatform()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendByteArray(byte[] bytes, Writer writer)If using native SQL then print a byte[] as '0xFF...'protected voidappendCalendar(Calendar calendar, Writer writer)Answer a platform correct string representation of a Calendar, suitable for SQL generation.protected voidappendDate(Date date, Writer writer)Answer a platform correct string representation of a Date, suitable for SQL generation.protected voidappendSybaseCalendar(Calendar calendar, Writer writer)Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff)protected voidappendSybaseTimestamp(Timestamp timestamp, Writer writer)Write a timestamp in Sybase specific format (yyyy-mm-dd-hh.mm.ss.fff).protected voidappendTime(Time time, Writer writer)Answer a platform correct string representation of a Time, suitable for SQL generation.protected voidappendTimestamp(Timestamp timestamp, Writer writer)Answer a platform correct string representation of a Timestamp, suitable for SQL generation.protected Hashtable<Class<?>,FieldTypeDefinition>buildFieldTypes()Return the mapping of class types to database types for the schema framework.ValueReadQuerybuildSelectQueryForIdentity()INTERNAL: Build the identity query for native sequencing.protected static ExpressionOperatorextractOperator()INTERNAL: Derby does not support EXTRACT, but does have DATEPART.StringgetBatchDelimiterString()Used for batch writing and sp defs.protected StringgetCreateTempTableSqlPrefix()INTERNAL:StringgetCreationInOutputProcedureToken()This method is used to print the required output parameter token for the specific platform.StringgetCreationOutputProcedureToken()This method is used to print the required output parameter token for the specific platform.StringgetInOutputProcedureToken()This method is used to print the output parameter token when stored procedures are calledintgetJDBCType(Class<?> javaType)Sybase and SQL Anywhere do not support BLOB/CLOB but require LONGVARBINARY/LONGVARCHAR.StringgetJdbcTypeName(int jdbcType)INTERNAL: Returns the type name corresponding to the jdbc typeintgetMaxFieldNameSize()INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.VectorgetNativeTableInfo(String table, String creator, AbstractSession session)Return the catalog information through using the native SQL catalog selects.StringgetOutputProcedureToken()This method is used to print the output parameter token when stored procedures are calledStringgetProcedureArgumentString()Used for sp defs.StringgetProcedureCallHeader()Used for sp calls.StringgetProcedureCallTail()Used for sp calls.StringgetSelectForUpdateString()Most database support a syntax.StringgetStoredProcedureParameterPrefix()DatabaseTablegetTempTableForTable(DatabaseTable table)INTERNAL:ValueReadQuerygetTimestampQuery()PUBLIC: This method returns the query to select the timestamp from the server for Sybase.protected Map<Integer,String>getTypeStrings()voidinitializeConnectionData(Connection connection)INTERNAL: Allow initialization from the connection.protected voidinitializePlatformOperators()Initialize any platform-specific operatorsprotected voidinitializeTypeStrings()booleanisOutputAllowWithResultSet()INTERNAL: Return true if output parameters can be built with result sets.booleanisSybase()Hashtable<Class<? extends Number>,? super Number>maximumNumericValues()Builds a table of maximum numeric values keyed on java class.Hashtable<Class<? extends Number>,? super Number>minimumNumericValues()Builds a table of minimum numeric values keyed on java class.protected static ExpressionOperatormodOperator()Override the default MOD operator.protected static ExpressionOperatoroperatorOuterJoin()Create the outer join operator for this platformvoidprintFieldIdentityClause(Writer writer)Append the receiver's field 'identity' constraint clause to a writer.voidprintFieldNullClause(Writer writer)Append the receiver's field 'NULL' constraint clause to a writer.voidregisterOutputParameter(CallableStatement statement, int index, int jdbcType)This method is used to register output parameter on Callable Statements for Stored Procedures as each database seems to have a different method.voidregisterOutputParameter(CallableStatement statement, int index, int jdbcType, String typeName)This method is used to register output parameter on CallableStatements for Stored Procedures as each database seems to have a different method.booleanrequiresProcedureCallBrackets()USed for sp calls.booleanrequiresProcedureCallOuputToken()Used for sp calls.booleanrequiresTypeNameToRegisterOutputParameter()INTERNAL: Indicates whether the version of CallableStatement.registerOutputParameter method that takes type name should be used.booleanshouldPrintInOutputTokenBeforeType()This is required in the construction of the stored procedures with output parametersbooleanshouldPrintLockingClauseAfterWhereClause()The sybase syntax for obtaining pessimistic lock is "SELECT ADDRESS_ID, ...booleanshouldPrintOutputTokenBeforeType()This is required in the construction of the stored procedures with output parametersbooleanshouldUseJDBCOuterJoinSyntax()JDBC defines and outer join syntax, many drivers do not support this.protected static ExpressionOperatorsingleArgumentSubstringOperator()Override the default SubstringSingleArg operator.booleansupportsDeleteOnCascade()Sybase (as of Sybase ASE 15, does not support delete on cascade).booleansupportsGlobalTempTables()INTERNAL:booleansupportsIdentity()INTERNAL: Indicates whether the platform supports identity.protected static ExpressionOperatorsybaseAddMonthsOperator()INTERNAL: Function, to add months to a date.protected static ExpressionOperatorsybaseInStringOperator()INTERNAL: Build instring operatorprotected static ExpressionOperatorsybaseLocate2Operator()INTERNAL: Build the Sybase equivalent to Locate with a start index.protected static ExpressionOperatorsybaseLocateOperator()INTERNAL: Build the Sybase equivalent to Locateprotected static ExpressionOperatorsybaseToCharOperator()INTERNAL: Build Sybase equivalent to TO_CHAR.protected static ExpressionOperatorsybaseToCharWithFormatOperator()INTERNAL: Build Sybase equivalent to TO_CHAR.protected static ExpressionOperatorsybaseToDateOperator()INTERNAL: Build Sybase equivalent to TO_DATE.protected static ExpressionOperatorsybaseToDateToStringOperator()INTERNAL: Build Sybase equivalent to TO_CHAR.protected static ExpressionOperatorsybaseToNumberOperator()INTERNAL: Build Sybase equivalent to TO_NUMBER.protected static ExpressionOperatortrim2Operator()INTERNAL: Build Trim operator.protected static ExpressionOperatortrimOperator()INTERNAL: Use RTRIM(LTRIM(?)) function for trim.booleanuseJDBCStoredProcedureSyntax()Return true if this platform is to use the JDBC supported syntax for executing stored procedures.voidwriteUpdateOriginalFromTempTableSql(Writer writer, DatabaseTable table, Collection<DatabaseField> pkFields, Collection<DatabaseField> assignedFields)INTERNAL:-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
addBatch, addStructConverter, allowBindingForSelectClause, allowsSizeInProcedureArguments, appendBoolean, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCallWithReturning, buildClassTypes, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildProcedureCallString, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, canBuildCallWithReturning, checkTableExists, commitTransaction, computeMaxRowsForSQL, convertToDatabaseType, copyInto, createArray, createArray, createPlatformDefaultSequence, createStruct, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, executeBatch, executeStoredProcedure, freeTemporaryObject, getAssignmentString, getBatchBeginString, getBatchEndString, getBatchRowCountAssignString, getBatchRowCountDeclareString, getBatchRowCountReturnString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConnectionUserName, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateTempTableSqlBodyForTable, getCreateTempTableSqlSuffix, getCreateViewString, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getDriverSupportsNVarChar, getDropCascadeString, getDropDatabaseSchemaString, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIndexNamePrefix, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCTypeForSetNull, getJsonPlatform, getMaxBatchWritingSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getObjectFromResultSet, getParameterValueFromDatabaseCall, getParameterValueFromDatabaseCall, getPartitioningCallback, getPingSQL, getProcedureArgument, getProcedureAsString, getProcedureBeginString, getProcedureEndString, getProcedureOptionList, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, getTableExistsQuery, getTransactionIsolation, getTypeConverters, getUniqueConstraintDeletionString, getUseNationalCharacterVaryingTypeForString, getVPDClearIdentifierQuery, getVPDCreationFunctionString, getVPDCreationPolicyString, getVPDDeletionString, getVPDSetIdentifierQuery, hasPartitioningCallback, initialize, isAlterSequenceObjectSupported, isCastRequired, isDynamicSQLRequiredForFunctions, isForUpdateCompatibleWithDistinct, isInformixOuterJoin, isJDBCExecuteCompliant, isLobCompatibleWithDistinct, isLockTimeoutException, isNullAllowedInSelectClause, isRowCountOutputParameterRequired, isXDBDocument, minimumTimeIncrement, prepareBatchStatement, printFieldNotNullClause, printFieldTypeSize, printFieldTypeSize, printFieldUnique, printFieldUnique, printSQLSelectStatement, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresTableInIndexDropDDL, requiresUniqueConstraintCreationOnTableCreate, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setBatchWritingMechanism, setCastSizeForVarcharParameter, setClassTypes, setCursorCode, setDriverName, setDriverSupportsNVarChar, setFieldTypes, setIsCastRequired, setMaxBatchWritingSize, setNullFromDatabaseField, setNullFromDatabaseField, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldBindPartialParameters, 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, shouldBindPartialParameters, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintForUpdateClause, shouldPrintInnerJoinInWhereClause, shouldPrintInputTokenAtStart, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenAtStart, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsForeignKeyConstraints, supportsIndexes, supportsIndividualTableLocking, supportsLocalTempTables, supportsLockingQueriesWithMultipleTables, supportsNestingOuterJoins, supportsOrderByParameters, 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, writeParameterMarker, writeTableCreationSuffix
-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addOperator, addSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, buildSelectQueryForSequenceObject, clone, convertObject, createConnectionCustomizer, createExpressionFor, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSeqenceAtNextValue, getDefaultSequence, getDefaultSequenceToWrite, getDriverVersion, getEndDelimiter, getINClauseLimit, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, getUUIDQuery, hasDefaultSequence, initializeDefaultQueries, initIdentitySequences, isAccess, isAttunity, isCloudscape, isDB2, isDB2Z, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMariaDB, isMaxDB, isMySQL, isODBC, isOracle, isOracle12, isOracle23, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeIdentitySequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSeqenceAtNextValue, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setSupportsReturnGeneratedKeys, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, setUUIDQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsNativeSequenceNumbers, supportsReturnGeneratedKeys, supportsSequenceObjects, toString, usesPlatformDefaultSequence
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.internal.databaseaccess.Platform
connectionProperties
-
-
-
-
Method Detail
-
initializeConnectionData
public void initializeConnectionData(Connection connection) throws SQLException
Description copied from class:DatabasePlatformINTERNAL: Allow initialization from the connection.- Overrides:
initializeConnectionDatain classDatabasePlatform- Throws:
SQLException
-
initializeTypeStrings
protected void initializeTypeStrings()
-
getJDBCType
public int getJDBCType(Class<?> javaType)
Sybase and SQL Anywhere do not support BLOB/CLOB but require LONGVARBINARY/LONGVARCHAR.- Overrides:
getJDBCTypein classDatabasePlatform
-
appendByteArray
protected void appendByteArray(byte[] bytes, Writer writer) throws IOExceptionIf using native SQL then print a byte[] as '0xFF...'- Overrides:
appendByteArrayin classDatabasePlatform- Throws:
IOException
-
appendDate
protected void appendDate(Date date, Writer writer) throws IOException
Answer a platform correct string representation of a Date, suitable for SQL generation. Native format: 'yyyy-mm-dd- Overrides:
appendDatein classDatabasePlatform- Throws:
IOException
-
appendSybaseTimestamp
protected void appendSybaseTimestamp(Timestamp timestamp, Writer writer) throws IOException
Write a timestamp in Sybase specific format (yyyy-mm-dd-hh.mm.ss.fff).- Throws:
IOException
-
appendTime
protected void appendTime(Time time, Writer writer) throws IOException
Answer a platform correct string representation of a Time, suitable for SQL generation. The time is printed in the ODBC platform independent format {t'hh:mm:ss'}.- Overrides:
appendTimein classDatabasePlatform- Throws:
IOException
-
appendTimestamp
protected void appendTimestamp(Timestamp timestamp, Writer writer) throws IOException
Answer a platform correct string representation of a Timestamp, suitable for SQL generation. The date is printed in the ODBC platform independent format {d'YYYY-MM-DD'}.- Overrides:
appendTimestampin classDatabasePlatform- Throws:
IOException
-
appendCalendar
protected void appendCalendar(Calendar calendar, Writer writer) throws IOException
Answer a platform correct string representation of a Calendar, suitable for SQL generation. The date is printed in the ODBC platform independent format {d'YYYY-MM-DD'}.- Overrides:
appendCalendarin classDatabasePlatform- Throws:
IOException
-
appendSybaseCalendar
protected void appendSybaseCalendar(Calendar calendar, Writer writer) throws IOException
Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff)- Throws:
IOException
-
buildFieldTypes
protected Hashtable<Class<?>,FieldTypeDefinition> buildFieldTypes()
Description copied from class:DatabasePlatformReturn the mapping of class types to database types for the schema framework.- Overrides:
buildFieldTypesin classDatabasePlatform
-
buildSelectQueryForIdentity
public ValueReadQuery buildSelectQueryForIdentity()
INTERNAL: Build the identity query for native sequencing.- Overrides:
buildSelectQueryForIdentityin classDatasourcePlatform
-
shouldPrintLockingClauseAfterWhereClause
public boolean shouldPrintLockingClauseAfterWhereClause()
The sybase syntax for obtaining pessimistic lock is "SELECT ADDRESS_ID, ... FROM ADDRESS WITH (HOLDLOCK) WHERE (ADDRESS_ID = ?)" Please note that above only obtains shared lock. Apparently there is no way to obtain exclusive lock on Sybase using only a select statement- Overrides:
shouldPrintLockingClauseAfterWhereClausein classDatabasePlatform
-
getSelectForUpdateString
public String getSelectForUpdateString()
Description copied from class:DatabasePlatformMost database support a syntax. although don't actually lock the row. Some require the OF some don't like it.- Overrides:
getSelectForUpdateStringin classDatabasePlatform
-
getBatchDelimiterString
public String getBatchDelimiterString()
Used for batch writing and sp defs.- Overrides:
getBatchDelimiterStringin classDatabasePlatform
-
getCreationInOutputProcedureToken
public String getCreationInOutputProcedureToken()
Description copied from class:DatabasePlatformThis method is used to print the required output parameter token for the specific platform. Used when stored procedures are created.- Overrides:
getCreationInOutputProcedureTokenin classDatabasePlatform
-
getCreationOutputProcedureToken
public String getCreationOutputProcedureToken()
Description copied from class:DatabasePlatformThis method is used to print the required output parameter token for the specific platform. Used when stored procedures are created.- Overrides:
getCreationOutputProcedureTokenin classDatabasePlatform
-
getInOutputProcedureToken
public String getInOutputProcedureToken()
Description copied from class:DatabasePlatformThis method is used to print the output parameter token when stored procedures are called- Overrides:
getInOutputProcedureTokenin classDatabasePlatform
-
getJdbcTypeName
public String getJdbcTypeName(int jdbcType)
INTERNAL: Returns the type name corresponding to the jdbc type- Overrides:
getJdbcTypeNamein classDatabasePlatform
-
getMaxFieldNameSize
public int getMaxFieldNameSize()
INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.- Overrides:
getMaxFieldNameSizein classDatabasePlatform
-
getNativeTableInfo
public Vector getNativeTableInfo(String table, String creator, AbstractSession session)
Return the catalog information through using the native SQL catalog selects. This is required because many JDBC driver do not support meta-data. Willcards can be passed as arguments.
-
getOutputProcedureToken
public String getOutputProcedureToken()
Description copied from class:DatabasePlatformThis method is used to print the output parameter token when stored procedures are called- Overrides:
getOutputProcedureTokenin classDatabasePlatform
-
getProcedureArgumentString
public String getProcedureArgumentString()
Used for sp defs.- Overrides:
getProcedureArgumentStringin classDatabasePlatform
-
getProcedureCallHeader
public String getProcedureCallHeader()
Used for sp calls.- Overrides:
getProcedureCallHeaderin classDatabasePlatform
-
getProcedureCallTail
public String getProcedureCallTail()
Description copied from class:DatabasePlatformUsed for sp calls.- Overrides:
getProcedureCallTailin classDatabasePlatform
-
useJDBCStoredProcedureSyntax
public boolean useJDBCStoredProcedureSyntax()
Return true if this platform is to use the JDBC supported syntax for executing stored procedures. If the driver is known to be the DataDirec driver, and the value is not set, then set to true and return.
-
getStoredProcedureParameterPrefix
public String getStoredProcedureParameterPrefix()
- Overrides:
getStoredProcedureParameterPrefixin classDatabasePlatform
-
getTimestampQuery
public ValueReadQuery getTimestampQuery()
PUBLIC: This method returns the query to select the timestamp from the server for Sybase.- Specified by:
getTimestampQueryin interfacePlatform- Overrides:
getTimestampQueryin classDatasourcePlatform
-
initializePlatformOperators
protected void initializePlatformOperators()
Initialize any platform-specific operators- Overrides:
initializePlatformOperatorsin classDatasourcePlatform
-
modOperator
protected static ExpressionOperator modOperator()
Override the default MOD operator.
-
operatorOuterJoin
protected static ExpressionOperator operatorOuterJoin()
Create the outer join operator for this platform
-
singleArgumentSubstringOperator
protected static ExpressionOperator singleArgumentSubstringOperator()
Override the default SubstringSingleArg operator.
-
sybaseAddMonthsOperator
protected static ExpressionOperator sybaseAddMonthsOperator()
INTERNAL: Function, to add months to a date.
-
sybaseInStringOperator
protected static ExpressionOperator sybaseInStringOperator()
INTERNAL: Build instring operator
-
sybaseToNumberOperator
protected static ExpressionOperator sybaseToNumberOperator()
INTERNAL: Build Sybase equivalent to TO_NUMBER.
-
sybaseToDateToStringOperator
protected static ExpressionOperator sybaseToDateToStringOperator()
INTERNAL: Build Sybase equivalent to TO_CHAR.
-
sybaseToDateOperator
protected static ExpressionOperator sybaseToDateOperator()
INTERNAL: Build Sybase equivalent to TO_DATE.
-
sybaseToCharOperator
protected static ExpressionOperator sybaseToCharOperator()
INTERNAL: Build Sybase equivalent to TO_CHAR.
-
sybaseToCharWithFormatOperator
protected static ExpressionOperator sybaseToCharWithFormatOperator()
INTERNAL: Build Sybase equivalent to TO_CHAR.
-
sybaseLocateOperator
protected static ExpressionOperator sybaseLocateOperator()
INTERNAL: Build the Sybase equivalent to Locate
-
sybaseLocate2Operator
protected static ExpressionOperator sybaseLocate2Operator()
INTERNAL: Build the Sybase equivalent to Locate with a start index. Sybase does not define this, so this gets a little complex...
-
extractOperator
protected static ExpressionOperator extractOperator()
INTERNAL: Derby does not support EXTRACT, but does have DATEPART.
-
trimOperator
protected static ExpressionOperator trimOperator()
INTERNAL: Use RTRIM(LTRIM(?)) function for trim.
-
trim2Operator
protected static ExpressionOperator trim2Operator()
INTERNAL: Build Trim operator.
-
isOutputAllowWithResultSet
public boolean isOutputAllowWithResultSet()
INTERNAL: Return true if output parameters can be built with result sets.- Overrides:
isOutputAllowWithResultSetin classDatabasePlatform
-
isSybase
public boolean isSybase()
- Specified by:
isSybasein interfacePlatform- Overrides:
isSybasein classDatasourcePlatform
-
maximumNumericValues
public Hashtable<Class<? extends Number>,? super Number> maximumNumericValues()
Builds a table of maximum numeric values keyed on java class. This is used for type testing but might also be useful to end users attempting to sanitize values.NOTE: BigInteger & BigDecimal maximums are dependent upon their precision & Scale
- Overrides:
maximumNumericValuesin classDatabasePlatform
-
minimumNumericValues
public Hashtable<Class<? extends Number>,? super Number> minimumNumericValues()
Builds a table of minimum numeric values keyed on java class. This is used for type testing but might also be useful to end users attempting to sanitize values.NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
- Overrides:
minimumNumericValuesin classDatabasePlatform
-
printFieldIdentityClause
public void printFieldIdentityClause(Writer writer) throws ValidationException
Append the receiver's field 'identity' constraint clause to a writer.- Overrides:
printFieldIdentityClausein classDatabasePlatform- Throws:
ValidationException
-
printFieldNullClause
public void printFieldNullClause(Writer writer) throws ValidationException
Append the receiver's field 'NULL' constraint clause to a writer.- Overrides:
printFieldNullClausein classDatabasePlatform- Throws:
ValidationException
-
registerOutputParameter
public void registerOutputParameter(CallableStatement statement, int index, int jdbcType) throws SQLException
This method is used to register output parameter on Callable Statements for Stored Procedures as each database seems to have a different method.- Overrides:
registerOutputParameterin classDatabasePlatform- Throws:
SQLException- See Also:
CallableStatement.registerOutParameter(int parameterIndex, int sqlType)
-
registerOutputParameter
public void registerOutputParameter(CallableStatement statement, int index, int jdbcType, String typeName) throws SQLException
Description copied from class:DatabasePlatformThis method is used to register output parameter on CallableStatements for Stored Procedures as each database seems to have a different method.- Overrides:
registerOutputParameterin classDatabasePlatform- Throws:
SQLException- See Also:
CallableStatement.registerOutParameter(int parameterIndex, int sqlType, String typeName)
-
requiresProcedureCallBrackets
public boolean requiresProcedureCallBrackets()
USed for sp calls.- Overrides:
requiresProcedureCallBracketsin classDatabasePlatform
-
requiresProcedureCallOuputToken
public boolean requiresProcedureCallOuputToken()
Used for sp calls. Sybase must print output after output params.- Overrides:
requiresProcedureCallOuputTokenin classDatabasePlatform
-
requiresTypeNameToRegisterOutputParameter
public boolean requiresTypeNameToRegisterOutputParameter()
INTERNAL: Indicates whether the version of CallableStatement.registerOutputParameter method that takes type name should be used.- Overrides:
requiresTypeNameToRegisterOutputParameterin classDatabasePlatform
-
shouldPrintInOutputTokenBeforeType
public boolean shouldPrintInOutputTokenBeforeType()
Description copied from class:DatabasePlatformThis is required in the construction of the stored procedures with output parameters- Overrides:
shouldPrintInOutputTokenBeforeTypein classDatabasePlatform
-
shouldPrintOutputTokenBeforeType
public boolean shouldPrintOutputTokenBeforeType()
Description copied from class:DatabasePlatformThis is required in the construction of the stored procedures with output parameters- Overrides:
shouldPrintOutputTokenBeforeTypein classDatabasePlatform
-
shouldUseJDBCOuterJoinSyntax
public boolean shouldUseJDBCOuterJoinSyntax()
JDBC defines and outer join syntax, many drivers do not support this. So we normally avoid it.- Overrides:
shouldUseJDBCOuterJoinSyntaxin classDatabasePlatform
-
supportsIdentity
public boolean supportsIdentity()
INTERNAL: Indicates whether the platform supports identity. Sybase does through IDENTITY field types. This method is to be used *ONLY* by sequencing classes- Overrides:
supportsIdentityin classDatasourcePlatform
-
supportsDeleteOnCascade
public boolean supportsDeleteOnCascade()
Sybase (as of Sybase ASE 15, does not support delete on cascade). Sybase ASA (SQL Anywhere does, so must use different platform).- Overrides:
supportsDeleteOnCascadein classDatabasePlatform
-
supportsGlobalTempTables
public boolean supportsGlobalTempTables()
INTERNAL:- Overrides:
supportsGlobalTempTablesin classDatabasePlatform
-
getCreateTempTableSqlPrefix
protected String getCreateTempTableSqlPrefix()
INTERNAL:- Overrides:
getCreateTempTableSqlPrefixin classDatabasePlatform
-
getTempTableForTable
public DatabaseTable getTempTableForTable(DatabaseTable table)
INTERNAL:- Overrides:
getTempTableForTablein classDatabasePlatform- Parameters:
table- is original table for which temp table is created.- Returns:
- temporary table
-
writeUpdateOriginalFromTempTableSql
public void writeUpdateOriginalFromTempTableSql(Writer writer, DatabaseTable table, Collection<DatabaseField> pkFields, Collection<DatabaseField> assignedFields) throws IOException
INTERNAL:- Overrides:
writeUpdateOriginalFromTempTableSqlin classDatabasePlatform- Parameters:
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.- Throws:
IOException
-
-