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

B15903-01


oracle.toplink.internal.databaseaccess
Class DatabasePlatform

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

All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
AccessPlatform, AttunityPlatform, CloudscapePlatform, DB2Platform, DBasePlatform, HSQLPlatform, InformixPlatform, OraclePlatform, PointBasePlatform, SDKPlatform, SQLServerPlatform, SybasePlatform

public class DatabasePlatform
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

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).

Since:
TOPLink/Java 1.0
See Also:
AccessPlatform, DB2Platform, DBasePlatform, OraclePlatform, SybasePlatform, Serialized Form

Field 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

DEFAULT_MAX_BATCH_WRITING_SIZE

public static int DEFAULT_MAX_BATCH_WRITING_SIZE
Bug#3214927 The default is 32000 for DynamicSQLBatchWritingMechanism. It would become 100 when switched to ParameterizedSQLBatchWritingMechanism.

DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE

public static int DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE

Constructor Detail

DatabasePlatform

public DatabasePlatform()

Method Detail

allowsSizeInProcedureArguments

public boolean allowsSizeInProcedureArguments()
Used for sp defs.

appendParameter

public 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. Determine the class of the object to be written, and invoke the appropriate print method for that object. The default is "toString". The platform may decide to bind some types, such as byte arrays and large strings.

autoCommit

public void autoCommit(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor)
                throws java.sql.SQLException
Used by JDBC drivers that do not support autocommit so simulate an autocommit.
Throws:
java.sql.SQLException

beginTransaction

public void beginTransaction(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor)
                      throws java.sql.SQLException
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.
Throws:
java.sql.SQLException

buildProcedureCallString

public java.lang.String buildProcedureCallString(StoredProcedureCall call,
                                                 oracle.toplink.publicinterface.Session session)
Return the proc syntax for this platform.

clone

public java.lang.Object clone()

commitTransaction

public void commitTransaction(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor)
                       throws java.sql.SQLException
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.
Throws:
java.sql.SQLException

convertObject

public java.lang.Object convertObject(java.lang.Object sourceObject,
                                      java.lang.Class javaClass)
                               throws ConversionException
Convert the object to the appropriate type by invoking the appropriate ConversionManager method
Parameters:
javaClass - - the class that the object must be converted to
Returns:
- the newly converted object
Throws:
- - ConversionException, all exceptions will be thrown as this type.
ConversionException

copyInto

public void copyInto(DatabasePlatform platform)
Copy the state into the new platform.

getBatchBeginString

public java.lang.String getBatchBeginString()
Used for batch writing and sp defs.

getBatchDelimiterString

public java.lang.String getBatchDelimiterString()
Used for batch writing and sp defs.

getBatchEndString

public java.lang.String getBatchEndString()
Used for batch writing and sp defs.

getClassTypes

public java.util.Hashtable getClassTypes()

getConversionManager

public ConversionManager getConversionManager()
The platform hold its own instance of conversion manager to allow customization.

getCreationInOutputProcedureToken

public java.lang.String getCreationInOutputProcedureToken()

getCreationOutputProcedureToken

public java.lang.String getCreationOutputProcedureToken()

getCursorCode

public int getCursorCode()
ADVANCED: Return the code for preparing cursored output parameters in a stored procedure

getFieldTypeDefinition

public 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.

getFieldTypes

public java.util.Hashtable getFieldTypes()

getJDBCType

public int getJDBCType(oracle.toplink.internal.helper.DatabaseField field)
Return the JDBC type for the given database field.

getJDBCType

public int getJDBCType(java.lang.Class javaType)
Return the JDBC type for the Java type.

getInOutputProcedureToken

public java.lang.String getInOutputProcedureToken()

getMaxBatchWritingSize

public int getMaxBatchWritingSize()
PUBLIC: Allow for the max batch writing size to be set. This allows for the batch size to be limited as most database have strict limits. The size is in characters, the default is 32000 but the real value depends on the database configuration.

getOperator

public ExpressionOperator getOperator(int selector)

getOutputProcedureToken

public java.lang.String getOutputProcedureToken()

getPlatformOperators

public java.util.Hashtable getPlatformOperators()
Return any platform-specific operators

getProcedureArgumentSetter

public java.lang.String getProcedureArgumentSetter()
Used for sp calls.

getProcedureArgumentString

public java.lang.String getProcedureArgumentString()
Used for sp defs.

getProcedureCallHeader

public java.lang.String getProcedureCallHeader()
Used for sp calls.

getProcedureCallTail

public java.lang.String getProcedureCallTail()
Used for sp calls.

getQualifiedSequenceTableName

public java.lang.String getQualifiedSequenceTableName()

getSelectForUpdateNoWaitString

public java.lang.String getSelectForUpdateNoWaitString()
This syntax does no wait on the lock. (i.e. In Oracle adding NOWAIT to the end will accomplish this)

getSelectForUpdateString

public java.lang.String getSelectForUpdateString()
Most database support a syntax. although don't actually lock the row. Some require the OF some don't like it.

getSelectSequenceQuery

public ValueReadQuery getSelectSequenceQuery()
This method lazy initializes the select sequence number query. It allows for other queries to be used instead of the default one.

getSequenceCounterFieldName

public java.lang.String getSequenceCounterFieldName()

getSequenceNameFieldName

public java.lang.String getSequenceNameFieldName()

getSequencePreallocationSize

public int getSequencePreallocationSize()

getSequenceTableName

public java.lang.String getSequenceTableName()

getStatementCacheSize

public int getStatementCacheSize()
The statement cache size for prepare parameterized statements.

getStoredProcedureParameterPrefix

public java.lang.String getStoredProcedureParameterPrefix()

getStoredProcedureTerminationToken

public java.lang.String getStoredProcedureTerminationToken()

getStringBindingSize

public int getStringBindingSize()

getTableQualifier

public java.lang.String getTableQualifier()

getTimestampFromServer

public java.sql.Timestamp getTimestampFromServer(oracle.toplink.publicinterface.Session session,
                                                 java.lang.String sessionName)
Answer the timestamp from the server.

getTimestampQuery

public ValueReadQuery getTimestampQuery()
This method can be overridden by subclasses to return a query that will return the timestamp from the server. return null if the time should be the local time.

getTransactionIsolation

public int getTransactionIsolation()
Returns the transaction isolation setting for a connection. Return -1 if it has not been set.

getUpdateSequenceQuery

public DataModifyQuery getUpdateSequenceQuery()
This method lazy initializes the update sequence number query. It allows for other queries to be used instead of the default one.

initializePreallocatedSequences

public void initializePreallocatedSequences()
Deprecated.
OBSOLETE: Use DatabaseSession.getSequencingControl().initializePreallocated() instead.

isAccess

public boolean isAccess()

isAttunity

public boolean isAttunity()

isCloudscape

public boolean isCloudscape()

isDB2

public boolean isDB2()

isDBase

public boolean isDBase()

isHSQL

public boolean isHSQL()

isInformix

public boolean isInformix()

isInformixOuterJoin

public boolean isInformixOuterJoin()
Some database require outer joins to be given in the where clause, others require it in the from clause. Informix requires it in the from clause with no ON expression.

isODBC

public boolean isODBC()

isOracle

public boolean isOracle()

isPointBase

public boolean isPointBase()

isSQLAnywhere

public boolean isSQLAnywhere()

isSQLServer

public boolean isSQLServer()

isSybase

public boolean isSybase()

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


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


printFieldIdentityClause

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

printFieldNotNullClause

public void printFieldNotNullClause(java.io.Writer writer)
                             throws ValidationException
Append the receiver's field 'NOT NULL' constraint clause to a writer.
Throws:
ValidationException

printFieldNullClause

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

printValuelist

public void printValuelist(int[] theObjects,
                           oracle.toplink.internal.databaseaccess.DatabaseCall call,
                           java.io.Writer writer)
                    throws java.io.IOException
Added November 7, 2000 JED Prs reference: 24501 Tracker reference: 14111 Print the int array on the writer. Added to handle int[] passed as parameters to named queries
Throws:
java.io.IOException

printValuelist

public void printValuelist(java.util.Vector theObjects,
                           oracle.toplink.internal.databaseaccess.DatabaseCall call,
                           java.io.Writer writer)
                    throws java.io.IOException
Throws:
java.io.IOException

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.
Throws:
java.sql.SQLException

requiresNamedPrimaryKeyConstraints

public boolean requiresNamedPrimaryKeyConstraints()
This is used as some databases create the primary key constraint differently, i.e. Access.

requiresProcedureCallBrackets

public boolean requiresProcedureCallBrackets()
USed for sp calls.

requiresProcedureCallOuputToken

public boolean requiresProcedureCallOuputToken()
Used for sp calls. Sybase must print output after output params.

rollbackTransaction

public void rollbackTransaction(oracle.toplink.internal.databaseaccess.DatabaseAccessor accessor)
                         throws java.sql.SQLException
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.
Throws:
java.sql.SQLException

setConversionManager

public void setConversionManager(ConversionManager conversionManager)
The platform hold its own instance of conversion manager to allow customization.

setCursorCode

public void setCursorCode(int cursorCode)
ADVANCED: Set the code for preparing cursored output parameters in a stored procedure

setMaxBatchWritingSize

public void setMaxBatchWritingSize(int maxBatchWritingSize)
PUBLIC: Allow for the max batch writing size to be set. This allows for the batch size to be limited as most database have strict limits. The size is in characters, the default is 32000 but the real value depends on the database configuration.

setSelectSequenceNumberQuery

public void setSelectSequenceNumberQuery(ValueReadQuery seqQuery)
PUBLIC: Can override the default query for returning the sequence numbers. This query must be a valid query that has one parameter which is the sequence name.

setSequenceCounterFieldName

public void setSequenceCounterFieldName(java.lang.String name)

setSequenceNameFieldName

public void setSequenceNameFieldName(java.lang.String name)

setSequencePreallocationSize

public void setSequencePreallocationSize(int size)
Set the number of sequence values to preallocate. Preallocating sequence values can greatly improve insert performance.

setSequenceTableName

public void setSequenceTableName(java.lang.String name)

setShouldBindAllParameters

public void setShouldBindAllParameters(boolean shouldBindAllParameters)
Bind all arguments to any SQL statement.

setShouldCacheAllStatements

public void setShouldCacheAllStatements(boolean shouldCacheAllStatements)
Cache all prepared statements, this requires full parameter binding as well.

setShouldForceFieldNamesToUpperCase

public 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.

setShouldIgnoreCaseOnFieldComparisons

public 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.

setShouldOptimizeDataConversion

public void setShouldOptimizeDataConversion(boolean value)
PUBLIC: Set if our driver level data conversion optimization is enabled. This can be disabled as some drivers perform data conversion themselves incorrectly.

setShouldTrimStrings

public void setShouldTrimStrings(boolean aBoolean)

setStatementCacheSize

public void setStatementCacheSize(int statementCacheSize)
The statement cache size for prepare parameterized statements.

setStringBindingSize

public void setStringBindingSize(int aSize)

setSupportsAutoCommit

public void setSupportsAutoCommit(boolean supportsAutoCommit)
supportsAutoCommit can be set to false for JDBC drivers which do not support autocommit
Returns:
boolean

setTableQualifier

public void setTableQualifier(java.lang.String qualifier)

setTimestampQuery

public void setTimestampQuery(ValueReadQuery tsQuery)
Can override the default query for returning a timestamp from the server. See: getTimestampFromServer

setTransactionIsolation

public void setTransactionIsolation(int isolationLevel)
Set the transaction isolation setting for a connection.

setUpdateSequenceQuery

public void setUpdateSequenceQuery(DataModifyQuery updateSequenceNumberQuery)
This method sets the update sequence number query. It allows for other queries to be used instead of the default one.

setUsesBatchWriting

public void setUsesBatchWriting(boolean usesBatchWriting)

setUsesByteArrayBinding

public void setUsesByteArrayBinding(boolean usesByteArrayBinding)

setUsesJDBCBatchWriting

public void setUsesJDBCBatchWriting(boolean usesJDBCBatchWriting)
Some JDBC 2 drivers to not support batching, so this lets are own batching be used.

setUsesNativeSQL

public void setUsesNativeSQL(boolean usesNativeSQL)

setUsesStreamsForBinding

public void setUsesStreamsForBinding(boolean usesStreamsForBinding)

setUsesStringBinding

public void setUsesStringBinding(boolean aBool)

shouldBindAllParameters

public boolean shouldBindAllParameters()
Bind all arguments to any SQL statement.

shouldCacheAllStatements

public boolean shouldCacheAllStatements()
Cache all prepared statements, this requires full parameter binding as well.

shouldForceFieldNamesToUpperCase

public boolean shouldForceFieldNamesToUpperCase()
Can be used if the app expects upper case but the database is not return consistent case, i.e. different databases.

shouldIgnoreCaseOnFieldComparisons

public 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.

shouldIgnoreException

public boolean shouldIgnoreException(java.sql.SQLException exception)
Allow for the platform to ignore exceptions. This is required for DB2 which throws no-data modified as an exception.

shouldOptimizeDataConversion

public boolean shouldOptimizeDataConversion()
Return if our driver level data conversion optimization is enabled. This can be disabled as some drivers perform data conversion themselves incorrectly.

shouldPrintConstraintNameAfter

public boolean shouldPrintConstraintNameAfter()
Some Platforms want the constraint name after the constraint definition.

shouldPrintInOutputTokenBeforeType

public boolean shouldPrintInOutputTokenBeforeType()

shouldPrintOuterJoinInWhereClause

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

shouldPrintOutputTokenBeforeType

public boolean shouldPrintOutputTokenBeforeType()

shouldTrimStrings

public boolean shouldTrimStrings()

shouldUseJDBCOuterJoinSyntax

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

supportsAutoCommit

public boolean supportsAutoCommit()
supportsAutoCommit must sometimes be set to false for JDBC drivers which do not support autocommit. Used to determine how to handle transactions properly.

supportsForeignKeyConstraints

public boolean supportsForeignKeyConstraints()

supportsNativeSequenceNumbers

public boolean supportsNativeSequenceNumbers()

supportsPrimaryKeyConstraint

public boolean supportsPrimaryKeyConstraint()

toString

public java.lang.String toString()

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
Throws:
java.sql.SQLException

usesBatchWriting

public boolean usesBatchWriting()
Return the next available sequence number.

usesByteArrayBinding

public boolean usesByteArrayBinding()

usesJDBCBatchWriting

public boolean usesJDBCBatchWriting()
Some JDBC 2 drivers to not support batching, so this lets are own batching be used.

usesNativeSequencing

public boolean usesNativeSequencing()

usesNativeSQL

public boolean usesNativeSQL()

usesSequenceTable

public boolean usesSequenceTable()

usesStreamsForBinding

public boolean usesStreamsForBinding()

usesStringBinding

public boolean usesStringBinding()

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