public class SybasePlatform extends DatabasePlatform
Purpose: Provides Sybase specific behaviour.
Responsibilities:
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Hashtable |
typeStrings |
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 |
|---|
SybasePlatform() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendByteArray(byte[] bytes,
java.io.Writer writer)
INTERNAL:
If using native SQL then print a byte[] as '0xFF...'
|
protected void |
appendCalendar(java.util.Calendar calendar,
java.io.Writer writer)
INTERNAL:
Answer a platform correct string representation of a Calendar, suitable for SQL generation.
|
protected void |
appendDate(java.sql.Date date,
java.io.Writer writer)
INTERNAL:
Answer a platform correct string representation of a Date, suitable for SQL generation.
|
protected void |
appendSybaseCalendar(java.util.Calendar calendar,
java.io.Writer writer)
INTERNAL:
Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff)
|
protected void |
appendSybaseTimestamp(java.sql.Timestamp timestamp,
java.io.Writer writer)
INTERNAL:
Write a timestamp in Sybase specific format (yyyy-mm-dd-hh.mm.ss.fff).
|
protected void |
appendTime(java.sql.Time time,
java.io.Writer writer)
INTERNAL:
Answer a platform correct string representation of a Time, suitable for SQL generation.
|
protected void |
appendTimestamp(java.sql.Timestamp timestamp,
java.io.Writer writer)
INTERNAL:
Answer a platform correct string representation of a Timestamp, suitable for SQL generation.
|
ExpressionOperator |
atan2Operator()
INTERNAL:
Build operator.
|
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.
|
java.lang.Object |
executeStoredProcedure(DatabaseCall dbCall,
java.sql.PreparedStatement statement,
DatabaseAccessor accessor,
AbstractSession session)
INTERNAL:
Because each platform has different requirements for accessing stored procedures and
the way that we can combine resultsets and output params the stored procedure call
is being executed on the platform.
|
java.lang.String |
getBatchDelimiterString()
INTERNAL:
Used for batch writing and sp defs.
|
protected java.lang.String |
getCreateTempTableSqlPrefix()
INTERNAL:
|
java.lang.String |
getCreationInOutputProcedureToken()
INTERNAL:
This method is used to print the required output parameter token for the
specific platform.
|
java.lang.String |
getCreationOutputProcedureToken()
INTERNAL:
This method was added because SQLServer requires the output paramater token
to be set on creation but not on execution.
|
java.lang.String |
getInOutputProcedureToken()
INTERNAL:
This method is used to print the output parameter token when stored
procedures are called
|
java.lang.String |
getJdbcTypeName(int jdbcType)
INTERNAL:
Returns the type name corresponding to the jdbc type
|
int |
getMaxFieldNameSize()
INTERNAL:
returns the maximum number of characters that can be used in a field
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 |
getOutputProcedureToken()
INTERNAL:
This method is used to print the output parameter token when stored
procedures are called
|
java.lang.String |
getProcedureArgumentString()
INTERNAL:
Used for sp defs.
|
java.lang.String |
getProcedureCallHeader()
INTERNAL:
Used for sp calls.
|
java.lang.String |
getStoredProcedureParameterPrefix()
INTERNAL:
|
java.lang.String |
getStoredProcedureTerminationToken()
INTERNAL:
This method returns the delimiter between stored procedures in multiple stored procedure
calls.
|
DatabaseTable |
getTempTableForTable(DatabaseTable table)
INTERNAL:
|
ValueReadQuery |
getTimestampQuery()
INTERNAL:
This method returns the query to select the timestamp
from the server for Sybase.
|
protected java.util.Hashtable |
getTypeStrings() |
protected void |
initializePlatformOperators()
INTERNAL:
Initialize any platform-specific operators
|
protected void |
initializeTypeStrings() |
boolean |
isSybase() |
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.
|
ExpressionOperator |
modOperator()
INTERNAL:
Override the default MOD operator.
|
protected ExpressionOperator |
operatorOuterJoin()
INTERNAL:
Create the outer join operator for this platform
|
void |
printFieldIdentityClause(java.io.Writer writer)
INTERNAL:
Append the receiver's field 'identity' constraint clause to a writer.
|
void |
printFieldNullClause(java.io.Writer writer)
INTERNAL:
Append the receiver's field 'NULL' constraint clause to a writer.
|
void |
registerOutputParameter(java.sql.CallableStatement statement,
int index,
int jdbcType)
INTERNAL:
This method is used to register output parameter on Callable Statements for Stored Procedures
as each database seems to have a different method.
|
boolean |
requiresProcedureCallBrackets()
INTERNAL:
USed for sp calls.
|
boolean |
requiresProcedureCallOuputToken()
INTERNAL:
Used for sp calls.
|
boolean |
requiresTypeNameToRegisterOutputParameter()
INTERNAL:
Indicates whether the version of CallableStatement.registerOutputParameter method
that takes type name should be used.
|
boolean |
shouldNativeSequenceAcquireValueAfterInsert()
INTERNAL:
If native sequencing is being used on Sybase then the values must be
retrieved after the insert.
|
boolean |
shouldPrintInOutputTokenBeforeType()
INTERNAL:
This is required in the construction of the stored procedures with
output parameters
|
boolean |
shouldPrintOuterJoinInWhereClause()
INTERNAL:
Some database require outer joins to be given in the where clause, others require it in the from clause.
|
boolean |
shouldPrintOutputTokenBeforeType()
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 |
supportsLocalTempTables()
INTERNAL:
|
boolean |
supportsNativeSequenceNumbers()
INTERNAL:
Return true if the receiver uses host sequence numbers, generated on the database.
|
void |
writeUpdateOriginalFromTempTableSql(java.io.Writer writer,
DatabaseTable table,
java.util.Collection pkFields,
java.util.Collection assignedFields)
INTERNAL:
|
allowsSizeInProcedureArguments, appendBoolean, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, autoCommit, beginTransaction, buildCallWithReturning, buildClassTypes, buildSelectQueryForNativeSequence, canBuildCallWithReturning, commitTransaction, convertToDatabaseType, copyInto, createPlatformDefaultSequence, dontBindUpdateAllQueryUsingTempTables, getAssignmentString, getBatchBeginString, getBatchEndString, getClassTypes, getConstraintDeletionString, getCreateTempTableSqlBodyForTable, getCreateTempTableSqlSuffix, getCreateViewString, getCursorCode, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getJDBCOuterJoinString, getJDBCType, getJDBCType, getMaxForeignKeyNameSize, getMaxUniqueKeyNameSize, getObjectFromResultSet, getProcedureArgumentSetter, getProcedureAsString, getProcedureBeginString, getProcedureCallTail, getProcedureEndString, getQualifiedSequenceTableName, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStringBindingSize, getTransactionIsolation, isInformixOuterJoin, isNullAllowedInSelectClause, printFieldIdentityClause, printFieldNotNullClause, printFieldTypeSize, printFieldUnique, printValuelist, printValuelist, processResultSet, requiresNamedPrimaryKeyConstraints, 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, shouldBindLiterals, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldNativeSequenceUseTransaction, shouldOptimizeDataConversion, shouldPrintConstraintNameAfter, shouldPrintOutputTokenAtStart, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, supportsAutoCommit, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueKeyConstraints, usesByteArrayBinding, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeParameterMarkeraddOperator, addSequence, clone, convertObject, createSequences, getConversionManager, getCustomModifyValueForCall, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultSequence, getDefaultSequenceToWrite, getOperator, getPlatformOperators, getSequence, getSequences, getSequencesToWrite, getTableQualifier, getTimestampFromServer, hasDefaultSequence, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isDerby, isHSQL, isInformix, isMySQL, isODBC, isOracle, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isTimesTen, platformSpecificSequencingInitialization, removeAllSequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultSequence, setSequences, setTableQualifier, setTimestampQuery, shouldUseCustomModifyForCall, toString, usesPlatformDefaultSequenceprotected java.util.Hashtable getTypeStrings()
protected void initializeTypeStrings()
protected 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 appendSybaseTimestamp(java.sql.Timestamp timestamp,
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 void appendSybaseCalendar(java.util.Calendar calendar,
java.io.Writer writer)
throws java.io.IOException
java.io.IOExceptionpublic ExpressionOperator atan2Operator()
protected java.util.Hashtable buildFieldTypes()
DatabasePlatformbuildFieldTypes in class DatabasePlatformpublic ValueReadQuery buildSelectQueryForNativeSequence()
buildSelectQueryForNativeSequence in class DatabasePlatformpublic java.lang.Object executeStoredProcedure(DatabaseCall dbCall, java.sql.PreparedStatement statement, DatabaseAccessor accessor, AbstractSession session) throws java.sql.SQLException
executeStoredProcedure in class DatabasePlatformjava.sql.SQLExceptionpublic java.lang.String getBatchDelimiterString()
getBatchDelimiterString in class DatabasePlatformpublic java.lang.String getCreationInOutputProcedureToken()
getCreationInOutputProcedureToken in class DatabasePlatformpublic java.lang.String getCreationOutputProcedureToken()
getCreationOutputProcedureToken in class DatabasePlatformpublic java.lang.String getInOutputProcedureToken()
getInOutputProcedureToken in class DatabasePlatformpublic java.lang.String getJdbcTypeName(int jdbcType)
getJdbcTypeName in class DatabasePlatformpublic int getMaxFieldNameSize()
getMaxFieldNameSize in class DatabasePlatformpublic java.util.Vector getNativeTableInfo(java.lang.String table,
java.lang.String creator,
AbstractSession session)
public java.lang.String getOutputProcedureToken()
getOutputProcedureToken in class DatabasePlatformpublic java.lang.String getProcedureArgumentString()
getProcedureArgumentString in class DatabasePlatformpublic java.lang.String getProcedureCallHeader()
getProcedureCallHeader in class DatabasePlatformpublic java.lang.String getStoredProcedureParameterPrefix()
getStoredProcedureParameterPrefix in class DatabasePlatformpublic java.lang.String getStoredProcedureTerminationToken()
getStoredProcedureTerminationToken in class DatabasePlatformpublic ValueReadQuery getTimestampQuery()
getTimestampQuery in interface PlatformgetTimestampQuery in class DatasourcePlatformprotected void initializePlatformOperators()
initializePlatformOperators in class DatasourcePlatformpublic boolean isSybase()
isSybase in interface PlatformisSybase 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 ExpressionOperator modOperator()
protected ExpressionOperator operatorOuterJoin()
public void printFieldIdentityClause(java.io.Writer writer)
throws ValidationException
printFieldIdentityClause in class DatabasePlatformValidationExceptionpublic void printFieldNullClause(java.io.Writer writer)
throws ValidationException
printFieldNullClause in class DatabasePlatformValidationExceptionpublic void registerOutputParameter(java.sql.CallableStatement statement,
int index,
int jdbcType)
throws java.sql.SQLException
registerOutputParameter in class DatabasePlatformjava.sql.SQLExceptionpublic boolean requiresProcedureCallBrackets()
requiresProcedureCallBrackets in class DatabasePlatformpublic boolean requiresProcedureCallOuputToken()
requiresProcedureCallOuputToken in class DatabasePlatformpublic boolean requiresTypeNameToRegisterOutputParameter()
requiresTypeNameToRegisterOutputParameter in class DatabasePlatformpublic boolean shouldPrintInOutputTokenBeforeType()
shouldPrintInOutputTokenBeforeType in class DatabasePlatformpublic boolean shouldPrintOuterJoinInWhereClause()
shouldPrintOuterJoinInWhereClause in class DatabasePlatformpublic boolean shouldPrintOutputTokenBeforeType()
shouldPrintOutputTokenBeforeType in class DatabasePlatformpublic boolean shouldNativeSequenceAcquireValueAfterInsert()
shouldNativeSequenceAcquireValueAfterInsert in class DatabasePlatformpublic boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax in class DatabasePlatformpublic boolean supportsNativeSequenceNumbers()
supportsNativeSequenceNumbers in class DatabasePlatformpublic boolean supportsLocalTempTables()
supportsLocalTempTables in class DatabasePlatformprotected java.lang.String getCreateTempTableSqlPrefix()
getCreateTempTableSqlPrefix in class DatabasePlatformpublic DatabaseTable getTempTableForTable(DatabaseTable table)
getTempTableForTable in class DatabasePlatformpublic void writeUpdateOriginalFromTempTableSql(java.io.Writer writer,
DatabaseTable table,
java.util.Collection pkFields,
java.util.Collection assignedFields)
throws java.io.IOException
writeUpdateOriginalFromTempTableSql in class DatabasePlatformjava.io.IOException