|
Oracle Application Server TopLink API Reference 10g Release 2 (10.1.2) B15903-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.toplink.internal.databaseaccess.DatabasePlatform
DatabasePlatform is private to TopLink. It encapsulates behavior specific to a database platform (eg. Oracle, Sybase, DBase), and provides protocol for TopLink to access this behavior. The behavior categories which require platform specific handling are SQL generation and sequence behavior. While database platform currently provides sequence number retrieval behaviour, this will move to a sequence manager (when it is implemented).
AccessPlatform
, DB2Platform
, DBasePlatform
, OraclePlatform
, SybasePlatform
, Serialized FormField Summary | |
static int |
DEFAULT_MAX_BATCH_WRITING_SIZE Bug#3214927 The default is 32000 for DynamicSQLBatchWritingMechanism. |
static int |
DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE |
Constructor Summary | |
DatabasePlatform() |
Method Summary | |
boolean |
allowsSizeInProcedureArguments() Used for sp defs. |
void |
appendParameter(oracle.toplink.internal.databaseaccess.DatabaseCall call, java.io.Writer writer, java.lang.Object parameter) Write a database-friendly representation of the given parameter to the writer. |
void |
autoCommit(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor) Used by JDBC drivers that do not support autocommit so simulate an autocommit. |
void |
beginTransaction(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor) Used for jdbc drivers which do not support autocommit to explicitly begin a transaction This method is a no-op for databases which implement autocommit as expected. |
java.lang.String |
buildProcedureCallString(StoredProcedureCall call, oracle.toplink.publicinterface.Session session) Return the proc syntax for this platform. |
java.lang.Object |
clone() |
void |
commitTransaction(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor) Used for jdbc drivers which do not support autocommit to explicitly commit a transaction This method is a no-op for databases which implement autocommit as expected. |
java.lang.Object |
convertObject(java.lang.Object sourceObject, java.lang.Class javaClass) Convert the object to the appropriate type by invoking the appropriate ConversionManager method |
void |
copyInto(DatabasePlatform platform) Copy the state into the new platform. |
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 |
getBatchBeginString() Used for batch writing and sp defs. |
java.lang.String |
getBatchDelimiterString() Used for batch writing and sp defs. |
java.lang.String |
getBatchEndString() Used for batch writing and sp defs. |
java.util.Hashtable |
getClassTypes() |
ConversionManager |
getConversionManager() The platform hold its own instance of conversion manager to allow customization. |
java.lang.String |
getCreationInOutputProcedureToken() |
java.lang.String |
getCreationOutputProcedureToken() |
int |
getCursorCode() ADVANCED: Return the code for preparing cursored output parameters in a stored procedure |
oracle.toplink.internal.databaseaccess.FieldTypeDefinition |
getFieldTypeDefinition(java.lang.Class javaClass) Return the field type object describing this databases platform specific representation of the Java primitive class name. |
java.util.Hashtable |
getFieldTypes() |
java.lang.String |
getInOutputProcedureToken() |
int |
getJDBCType(java.lang.Class javaType) Return the JDBC type for the Java type. |
int |
getJDBCType(oracle.toplink.internal.helper.DatabaseField field) Return the JDBC type for the given database field. |
int |
getMaxBatchWritingSize() PUBLIC: Allow for the max batch writing size to be set. |
ExpressionOperator |
getOperator(int selector) |
java.lang.String |
getOutputProcedureToken() |
java.util.Hashtable |
getPlatformOperators() Return any platform-specific operators |
java.lang.String |
getProcedureArgumentSetter() Used for sp calls. |
java.lang.String |
getProcedureArgumentString() Used for sp defs. |
java.lang.String |
getProcedureCallHeader() Used for sp calls. |
java.lang.String |
getProcedureCallTail() Used for sp calls. |
java.lang.String |
getQualifiedSequenceTableName() |
java.lang.String |
getSelectForUpdateNoWaitString() This syntax does no wait on the lock. |
java.lang.String |
getSelectForUpdateString() Most database support a syntax. although don't actually lock the row. |
ValueReadQuery |
getSelectSequenceQuery() This method lazy initializes the select sequence number query. |
java.lang.String |
getSequenceCounterFieldName() |
java.lang.String |
getSequenceNameFieldName() |
int |
getSequencePreallocationSize() |
java.lang.String |
getSequenceTableName() |
int |
getStatementCacheSize() The statement cache size for prepare parameterized statements. |
java.lang.String |
getStoredProcedureParameterPrefix() |
java.lang.String |
getStoredProcedureTerminationToken() |
int |
getStringBindingSize() |
java.lang.String |
getTableQualifier() |
java.sql.Timestamp |
getTimestampFromServer(oracle.toplink.publicinterface.Session session, java.lang.String sessionName) Answer the timestamp from the server. |
ValueReadQuery |
getTimestampQuery() This method can be overridden by subclasses to return a query that will return the timestamp from the server. |
int |
getTransactionIsolation() Returns the transaction isolation setting for a connection. |
DataModifyQuery |
getUpdateSequenceQuery() This method lazy initializes the update sequence number query. |
void |
initializePreallocatedSequences() Deprecated. |
boolean |
isAccess() |
boolean |
isAttunity() |
boolean |
isCloudscape() |
boolean |
isDB2() |
boolean |
isDBase() |
boolean |
isHSQL() |
boolean |
isInformix() |
boolean |
isInformixOuterJoin() Some database require outer joins to be given in the where clause, others require it in the from clause. |
boolean |
isODBC() |
boolean |
isOracle() |
boolean |
isPointBase() |
boolean |
isSQLAnywhere() |
boolean |
isSQLServer() |
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. |
void |
printFieldIdentityClause(java.io.Writer writer) Append the receiver's field 'identity' constraint clause to a writer. |
void |
printFieldNotNullClause(java.io.Writer writer) Append the receiver's field 'NOT NULL' constraint clause to a writer. |
void |
printFieldNullClause(java.io.Writer writer) Append the receiver's field 'NULL' constraint clause to a writer. |
void |
printValuelist(int[] theObjects, oracle.toplink.internal.databaseaccess.DatabaseCall call, java.io.Writer writer) Added November 7, 2000 JED Prs reference: 24501 Tracker reference: 14111 Print the int array on the writer. |
void |
printValuelist(java.util.Vector theObjects, oracle.toplink.internal.databaseaccess.DatabaseCall call, java.io.Writer 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 |
requiresNamedPrimaryKeyConstraints() This is used as some databases create the primary key constraint differently, i.e. |
boolean |
requiresProcedureCallBrackets() USed for sp calls. |
boolean |
requiresProcedureCallOuputToken() Used for sp calls. |
void |
rollbackTransaction(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor) Used for jdbc drivers which do not support autocommit to explicitly rollback a transaction This method is a no-op for databases which implement autocommit as expected. |
void |
setConversionManager(ConversionManager conversionManager) The platform hold its own instance of conversion manager to allow customization. |
void |
setCursorCode(int cursorCode) ADVANCED: Set the code for preparing cursored output parameters in a stored procedure |
void |
setMaxBatchWritingSize(int maxBatchWritingSize) PUBLIC: Allow for the max batch writing size to be set. |
void |
setSelectSequenceNumberQuery(ValueReadQuery seqQuery) PUBLIC: Can override the default query for returning the sequence numbers. |
void |
setSequenceCounterFieldName(java.lang.String name) |
void |
setSequenceNameFieldName(java.lang.String name) |
void |
setSequencePreallocationSize(int size) Set the number of sequence values to preallocate. |
void |
setSequenceTableName(java.lang.String name) |
void |
setShouldBindAllParameters(boolean shouldBindAllParameters) Bind all arguments to any SQL statement. |
void |
setShouldCacheAllStatements(boolean shouldCacheAllStatements) Cache all prepared statements, this requires full parameter binding as well. |
void |
setShouldForceFieldNamesToUpperCase(boolean shouldForceFieldNamesToUpperCase) Can be used if the app expects upper case but the database is not return consistent case, i.e. different databases. |
static void |
setShouldIgnoreCaseOnFieldComparisons(boolean newShouldIgnoreCaseOnFieldComparisons) Allow for case in field names to be ignored as some databases are not case sensitive and when using custom this can be an issue. |
void |
setShouldOptimizeDataConversion(boolean value) PUBLIC: Set if our driver level data conversion optimization is enabled. |
void |
setShouldTrimStrings(boolean aBoolean) |
void |
setStatementCacheSize(int statementCacheSize) The statement cache size for prepare parameterized statements. |
void |
setStringBindingSize(int aSize) |
void |
setSupportsAutoCommit(boolean supportsAutoCommit) supportsAutoCommit can be set to false for JDBC drivers which do not support autocommit |
void |
setTableQualifier(java.lang.String qualifier) |
void |
setTimestampQuery(ValueReadQuery tsQuery) Can override the default query for returning a timestamp from the server. |
void |
setTransactionIsolation(int isolationLevel) Set the transaction isolation setting for a connection. |
void |
setUpdateSequenceQuery(DataModifyQuery updateSequenceNumberQuery) This method sets the update sequence number query. |
void |
setUsesBatchWriting(boolean usesBatchWriting) |
void |
setUsesByteArrayBinding(boolean usesByteArrayBinding) |
void |
setUsesJDBCBatchWriting(boolean usesJDBCBatchWriting) Some JDBC 2 drivers to not support batching, so this lets are own batching be used. |
void |
setUsesNativeSQL(boolean usesNativeSQL) |
void |
setUsesStreamsForBinding(boolean usesStreamsForBinding) |
void |
setUsesStringBinding(boolean aBool) |
boolean |
shouldBindAllParameters() Bind all arguments to any SQL statement. |
boolean |
shouldCacheAllStatements() Cache all prepared statements, this requires full parameter binding as well. |
boolean |
shouldForceFieldNamesToUpperCase() Can be used if the app expects upper case but the database is not return consistent case, i.e. different databases. |
static boolean |
shouldIgnoreCaseOnFieldComparisons() Allow for case in field names to be ignored as some databases are not case sensitive and when using custom this can be an issue. |
boolean |
shouldIgnoreException(java.sql.SQLException exception) Allow for the platform to ignore exceptions. |
boolean |
shouldOptimizeDataConversion() Return if our driver level data conversion optimization is enabled. |
boolean |
shouldPrintConstraintNameAfter() Some Platforms want the constraint name after the constraint definition. |
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 |
shouldTrimStrings() |
boolean |
shouldUseJDBCOuterJoinSyntax() JDBC defines and outer join syntax, many drivers do not support this. |
boolean |
supportsAutoCommit() supportsAutoCommit must sometimes be set to false for JDBC drivers which do not support autocommit. |
boolean |
supportsForeignKeyConstraints() |
boolean |
supportsNativeSequenceNumbers() |
boolean |
supportsPrimaryKeyConstraint() |
java.lang.String |
toString() |
boolean |
usesBatchWriting() Return the next available sequence number. |
boolean |
usesByteArrayBinding() |
boolean |
usesJDBCBatchWriting() Some JDBC 2 drivers to not support batching, so this lets are own batching be used. |
boolean |
usesNativeSequencing() |
boolean |
usesNativeSQL() |
boolean |
usesSequenceTable() |
boolean |
usesStreamsForBinding() |
boolean |
usesStringBinding() |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static int DEFAULT_MAX_BATCH_WRITING_SIZE
public static int DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE
Constructor Detail |
public DatabasePlatform()
Method Detail |
public boolean allowsSizeInProcedureArguments()
public void appendParameter(oracle.toplink.internal.databaseaccess.DatabaseCall call, java.io.Writer writer, java.lang.Object parameter)
public void autoCommit(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor) throws java.sql.SQLException
java.sql.SQLException
public void beginTransaction(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String buildProcedureCallString(StoredProcedureCall call, oracle.toplink.publicinterface.Session session)
public java.lang.Object clone()
public void commitTransaction(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor) throws java.sql.SQLException
java.sql.SQLException
public java.lang.Object convertObject(java.lang.Object sourceObject, java.lang.Class javaClass) throws ConversionException
javaClass
- - the class that the object must be converted to-
- ConversionException, all exceptions will be thrown as this type.ConversionException
public void copyInto(DatabasePlatform platform)
public java.lang.String getBatchBeginString()
public java.lang.String getBatchDelimiterString()
public java.lang.String getBatchEndString()
public java.util.Hashtable getClassTypes()
public ConversionManager getConversionManager()
public java.lang.String getCreationInOutputProcedureToken()
public java.lang.String getCreationOutputProcedureToken()
public int getCursorCode()
public oracle.toplink.internal.databaseaccess.FieldTypeDefinition getFieldTypeDefinition(java.lang.Class javaClass)
public java.util.Hashtable getFieldTypes()
public int getJDBCType(oracle.toplink.internal.helper.DatabaseField field)
public int getJDBCType(java.lang.Class javaType)
public java.lang.String getInOutputProcedureToken()
public int getMaxBatchWritingSize()
public ExpressionOperator getOperator(int selector)
public java.lang.String getOutputProcedureToken()
public java.util.Hashtable getPlatformOperators()
public java.lang.String getProcedureArgumentSetter()
public java.lang.String getProcedureArgumentString()
public java.lang.String getProcedureCallHeader()
public java.lang.String getProcedureCallTail()
public java.lang.String getQualifiedSequenceTableName()
public java.lang.String getSelectForUpdateNoWaitString()
public java.lang.String getSelectForUpdateString()
public ValueReadQuery getSelectSequenceQuery()
public java.lang.String getSequenceCounterFieldName()
public java.lang.String getSequenceNameFieldName()
public int getSequencePreallocationSize()
public java.lang.String getSequenceTableName()
public int getStatementCacheSize()
public java.lang.String getStoredProcedureParameterPrefix()
public java.lang.String getStoredProcedureTerminationToken()
public int getStringBindingSize()
public java.lang.String getTableQualifier()
public java.sql.Timestamp getTimestampFromServer(oracle.toplink.publicinterface.Session session, java.lang.String sessionName)
public ValueReadQuery getTimestampQuery()
public int getTransactionIsolation()
public DataModifyQuery getUpdateSequenceQuery()
public void initializePreallocatedSequences()
public boolean isAccess()
public boolean isAttunity()
public boolean isCloudscape()
public boolean isDB2()
public boolean isDBase()
public boolean isHSQL()
public boolean isInformix()
public boolean isInformixOuterJoin()
public boolean isODBC()
public boolean isOracle()
public boolean isPointBase()
public boolean isSQLAnywhere()
public boolean isSQLServer()
public boolean isSybase()
public java.util.Hashtable maximumNumericValues()
NOTE: BigInteger & BigDecimal maximums are dependent upon their precision & Scale
public java.util.Hashtable minimumNumericValues()
NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
public void printFieldIdentityClause(java.io.Writer writer) throws ValidationException
ValidationException
public void printFieldNotNullClause(java.io.Writer writer) throws ValidationException
ValidationException
public void printFieldNullClause(java.io.Writer writer) throws ValidationException
ValidationException
public void printValuelist(int[] theObjects, oracle.toplink.internal.databaseaccess.DatabaseCall call, java.io.Writer writer) throws java.io.IOException
java.io.IOException
public void printValuelist(java.util.Vector theObjects, oracle.toplink.internal.databaseaccess.DatabaseCall call, java.io.Writer writer) throws java.io.IOException
java.io.IOException
public void registerOutputParameter(java.sql.CallableStatement statement, int index, int jdbcType) throws java.sql.SQLException
java.sql.SQLException
public boolean requiresNamedPrimaryKeyConstraints()
public boolean requiresProcedureCallBrackets()
public boolean requiresProcedureCallOuputToken()
public void rollbackTransaction(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor) throws java.sql.SQLException
java.sql.SQLException
public void setConversionManager(ConversionManager conversionManager)
public void setCursorCode(int cursorCode)
public void setMaxBatchWritingSize(int maxBatchWritingSize)
public void setSelectSequenceNumberQuery(ValueReadQuery seqQuery)
public void setSequenceCounterFieldName(java.lang.String name)
public void setSequenceNameFieldName(java.lang.String name)
public void setSequencePreallocationSize(int size)
public void setSequenceTableName(java.lang.String name)
public void setShouldBindAllParameters(boolean shouldBindAllParameters)
public void setShouldCacheAllStatements(boolean shouldCacheAllStatements)
public void setShouldForceFieldNamesToUpperCase(boolean shouldForceFieldNamesToUpperCase)
public static void setShouldIgnoreCaseOnFieldComparisons(boolean newShouldIgnoreCaseOnFieldComparisons)
public void setShouldOptimizeDataConversion(boolean value)
public void setShouldTrimStrings(boolean aBoolean)
public void setStatementCacheSize(int statementCacheSize)
public void setStringBindingSize(int aSize)
public void setSupportsAutoCommit(boolean supportsAutoCommit)
public void setTableQualifier(java.lang.String qualifier)
public void setTimestampQuery(ValueReadQuery tsQuery)
public void setTransactionIsolation(int isolationLevel)
public void setUpdateSequenceQuery(DataModifyQuery updateSequenceNumberQuery)
public void setUsesBatchWriting(boolean usesBatchWriting)
public void setUsesByteArrayBinding(boolean usesByteArrayBinding)
public void setUsesJDBCBatchWriting(boolean usesJDBCBatchWriting)
public void setUsesNativeSQL(boolean usesNativeSQL)
public void setUsesStreamsForBinding(boolean usesStreamsForBinding)
public void setUsesStringBinding(boolean aBool)
public boolean shouldBindAllParameters()
public boolean shouldCacheAllStatements()
public boolean shouldForceFieldNamesToUpperCase()
public static boolean shouldIgnoreCaseOnFieldComparisons()
public boolean shouldIgnoreException(java.sql.SQLException exception)
public boolean shouldOptimizeDataConversion()
public boolean shouldPrintConstraintNameAfter()
public boolean shouldPrintInOutputTokenBeforeType()
public boolean shouldPrintOuterJoinInWhereClause()
public boolean shouldPrintOutputTokenBeforeType()
public boolean shouldTrimStrings()
public boolean shouldUseJDBCOuterJoinSyntax()
public boolean supportsAutoCommit()
public boolean supportsForeignKeyConstraints()
public boolean supportsNativeSequenceNumbers()
public boolean supportsPrimaryKeyConstraint()
public java.lang.String toString()
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
java.sql.SQLException
public boolean usesBatchWriting()
public boolean usesByteArrayBinding()
public boolean usesJDBCBatchWriting()
public boolean usesNativeSequencing()
public boolean usesNativeSQL()
public boolean usesSequenceTable()
public boolean usesStreamsForBinding()
public boolean usesStringBinding()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |