Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.internal.databaseaccess
Class SybasePlatform

java.lang.Object
  extended byoracle.toplink.internal.databaseaccess.DatabasePlatform
      extended byoracle.toplink.internal.databaseaccess.SybasePlatform

All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
SQLAnyWherePlatform

public class SybasePlatform
extends DatabasePlatform

Purpose: Provides Sybase specific behaviour.

Responsibilities:

Since:
TOPLink/Java 1.0
See Also:
Serialized Form

Field Summary

Fields inherited from class oracle.toplink.internal.databaseaccess.DatabasePlatform
DEFAULT_MAX_BATCH_WRITING_SIZE, DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE

Constructor Summary
SybasePlatform()

Method Summary
java.lang.Object executeStoredProcedureCall(StoredProcedureCall dbCall, java.sql.PreparedStatement statement, oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor, oracle.toplink.publicinterface.Session session)
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()
Used for batch writing and sp defs.
java.lang.String getCreationInOutputProcedureToken()
java.lang.String getCreationOutputProcedureToken()
java.lang.String getInOutputProcedureToken()
java.util.Vector getNativeTableInfo(java.lang.String table, java.lang.String creator, oracle.toplink.publicinterface.Session session)
Return the catalog information through using the native SQL catalog selects.
java.lang.String getOutputProcedureToken()
java.lang.String getProcedureArgumentString()
Used for sp defs.
java.lang.String getProcedureCallHeader()
Used for sp calls.
java.lang.String getStoredProcedureParameterPrefix()
ValueReadQuery getTimestampQuery()
PUBLIC: This method returns the query to select the timestamp from the server for Sybase.
boolean isSybase()
java.util.Hashtable maximumNumericValues()
Builds a table of maximum numeric values keyed on java class.
java.util.Hashtable minimumNumericValues()
Builds a table of minimum numeric values keyed on java class.
ExpressionOperator modOperator()
Override the default MOD operator.
void printFieldIdentityClause(java.io.Writer writer)
Append the receiver's field 'identity' constraint clause to a writer.
void printFieldNullClause(java.io.Writer writer)
Append the receiver's field 'NULL' constraint clause to a writer.
void registerOutputParameter(java.sql.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.
boolean requiresProcedureCallBrackets()
USed for sp calls.
boolean requiresProcedureCallOuputToken()
Used for sp calls.
boolean shouldPrintInOutputTokenBeforeType()
boolean shouldPrintOuterJoinInWhereClause()
Some database require outer joins to be given in the where clause, others require it in the from clause.
boolean shouldPrintOutputTokenBeforeType()
boolean shouldUseJDBCOuterJoinSyntax()
JDBC defines and outer join syntax, many drivers do not support this.
boolean supportsNativeSequenceNumbers()
Return true if the receiver uses host sequence numbers, generated on the database.

Methods inherited from class oracle.toplink.internal.databaseaccess.DatabasePlatform
allowsSizeInProcedureArguments, appendParameter, autoCommit, beginTransaction, buildProcedureCallString, clone, commitTransaction, convertObject, copyInto, getBatchBeginString, getBatchEndString, getClassTypes, getConversionManager, getCursorCode, getFieldTypeDefinition, getFieldTypes, getJDBCType, getJDBCType, getMaxBatchWritingSize, getOperator, getPlatformOperators, getProcedureArgumentSetter, getProcedureCallTail, getQualifiedSequenceTableName, getSelectForUpdateNoWaitString, getSelectForUpdateString, getSelectSequenceQuery, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStringBindingSize, getTableQualifier, getTimestampFromServer, getTransactionIsolation, getUpdateSequenceQuery, initializePreallocatedSequences, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isHSQL, isInformix, isInformixOuterJoin, isODBC, isOracle, isPointBase, isSQLAnywhere, isSQLServer, printFieldNotNullClause, printValuelist, printValuelist, requiresNamedPrimaryKeyConstraints, rollbackTransaction, setConversionManager, setCursorCode, setMaxBatchWritingSize, setSelectSequenceNumberQuery, setSequenceCounterFieldName, setSequenceNameFieldName, setSequencePreallocationSize, setSequenceTableName, setShouldBindAllParameters, setShouldCacheAllStatements, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTableQualifier, setTimestampQuery, setTransactionIsolation, setUpdateSequenceQuery, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldBindAllParameters, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldOptimizeDataConversion, shouldPrintConstraintNameAfter, shouldTrimStrings, supportsAutoCommit, supportsForeignKeyConstraints, supportsPrimaryKeyConstraint, toString, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeSequencing, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SybasePlatform

public SybasePlatform()

Method Detail

executeStoredProcedureCall

public java.lang.Object executeStoredProcedureCall(StoredProcedureCall dbCall,
                                                   java.sql.PreparedStatement statement,
                                                   oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor,
                                                   oracle.toplink.publicinterface.Session session)
                                            throws java.sql.SQLException
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. This entire process needs some serious refactoring to eliminate the chance of bugs.
Overrides:
executeStoredProcedureCall in class DatabasePlatform
Throws:
java.sql.SQLException

getBatchDelimiterString

public java.lang.String getBatchDelimiterString()
Used for batch writing and sp defs.
Overrides:
getBatchDelimiterString in class DatabasePlatform

getCreationInOutputProcedureToken

public java.lang.String getCreationInOutputProcedureToken()
Overrides:
getCreationInOutputProcedureToken in class DatabasePlatform

getCreationOutputProcedureToken

public java.lang.String getCreationOutputProcedureToken()
Overrides:
getCreationOutputProcedureToken in class DatabasePlatform

getInOutputProcedureToken

public java.lang.String getInOutputProcedureToken()
Overrides:
getInOutputProcedureToken in class DatabasePlatform

getNativeTableInfo

public java.util.Vector getNativeTableInfo(java.lang.String table,
                                           java.lang.String creator,
                                           oracle.toplink.publicinterface.Session 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 java.lang.String getOutputProcedureToken()
Overrides:
getOutputProcedureToken in class DatabasePlatform

getProcedureArgumentString

public java.lang.String getProcedureArgumentString()
Used for sp defs.
Overrides:
getProcedureArgumentString in class DatabasePlatform

getProcedureCallHeader

public java.lang.String getProcedureCallHeader()
Used for sp calls.
Overrides:
getProcedureCallHeader in class DatabasePlatform

getStoredProcedureParameterPrefix

public java.lang.String getStoredProcedureParameterPrefix()
Overrides:
getStoredProcedureParameterPrefix in class DatabasePlatform

getTimestampQuery

public ValueReadQuery getTimestampQuery()
PUBLIC: This method returns the query to select the timestamp from the server for Sybase.
Overrides:
getTimestampQuery in class DatabasePlatform

isSybase

public boolean isSybase()
Overrides:
isSybase in class DatabasePlatform

maximumNumericValues

public java.util.Hashtable 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:
maximumNumericValues in class DatabasePlatform

minimumNumericValues

public java.util.Hashtable 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:
minimumNumericValues in class DatabasePlatform

modOperator

public ExpressionOperator modOperator()
Override the default MOD operator.

printFieldIdentityClause

public void printFieldIdentityClause(java.io.Writer writer)
                              throws ValidationException
Append the receiver's field 'identity' constraint clause to a writer.
Overrides:
printFieldIdentityClause in class DatabasePlatform
Throws:
ValidationException

printFieldNullClause

public void printFieldNullClause(java.io.Writer writer)
                          throws ValidationException
Append the receiver's field 'NULL' constraint clause to a writer.
Overrides:
printFieldNullClause in class DatabasePlatform
Throws:
ValidationException

registerOutputParameter

public void registerOutputParameter(java.sql.CallableStatement statement,
                                    int index,
                                    int jdbcType)
                             throws java.sql.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:
registerOutputParameter in class DatabasePlatform
Throws:
java.sql.SQLException

requiresProcedureCallBrackets

public boolean requiresProcedureCallBrackets()
USed for sp calls.
Overrides:
requiresProcedureCallBrackets in class DatabasePlatform

requiresProcedureCallOuputToken

public boolean requiresProcedureCallOuputToken()
Used for sp calls. Sybase must print output after output params.
Overrides:
requiresProcedureCallOuputToken in class DatabasePlatform

shouldPrintInOutputTokenBeforeType

public boolean shouldPrintInOutputTokenBeforeType()
Overrides:
shouldPrintInOutputTokenBeforeType in class DatabasePlatform

shouldPrintOuterJoinInWhereClause

public boolean shouldPrintOuterJoinInWhereClause()
Some database require outer joins to be given in the where clause, others require it in the from clause.
Overrides:
shouldPrintOuterJoinInWhereClause in class DatabasePlatform

shouldPrintOutputTokenBeforeType

public boolean shouldPrintOutputTokenBeforeType()
Overrides:
shouldPrintOutputTokenBeforeType in class DatabasePlatform

shouldUseJDBCOuterJoinSyntax

public boolean shouldUseJDBCOuterJoinSyntax()
JDBC defines and outer join syntax, many drivers do not support this. So we normally avoid it.
Overrides:
shouldUseJDBCOuterJoinSyntax in class DatabasePlatform

supportsNativeSequenceNumbers

public boolean supportsNativeSequenceNumbers()
Return true if the receiver uses host sequence numbers, generated on the database. Sybase does through IDENTITY field types.
Overrides:
supportsNativeSequenceNumbers in class DatabasePlatform

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.