Package org.apache.openjpa.jdbc.sql
Class DB2Dictionary
- java.lang.Object
-
- org.apache.openjpa.jdbc.sql.DBDictionary
-
- org.apache.openjpa.jdbc.sql.AbstractDB2Dictionary
-
- org.apache.openjpa.jdbc.sql.DB2Dictionary
-
- All Implemented Interfaces:
JoinSyntaxes
,Configurable
,IdentifierConfiguration
,ConnectionDecorator
,LoggingConnectionDecorator.SQLWarningHandler
public class DB2Dictionary extends AbstractDB2Dictionary
Dictionary for IBM DB2 database.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
DBDictionary.DateMillisecondBehaviors, DBDictionary.SerializedData
-
-
Field Summary
Fields Modifier and Type Field Description boolean
appendExtendedExceptionText
static int
db2ISeriesV5R3OrEarlier
static int
db2ISeriesV5R4OrLater
protected int
db2ServerType
static int
db2UDBV81OrEarlier
static int
db2UDBV82OrLater
static int
db2ZOSV8xOrLater
protected static java.lang.String
defaultSequenceSQL
protected static java.lang.String
forReadOnlyClause
protected static java.lang.String
forUpdate
java.lang.String
optimizeClause
java.lang.String
rowClause
boolean
supportsRowNum
Affirms whether this dictionary usesROWNUM
feature.protected static java.lang.String
useKeepExclusiveLockClause
protected static java.lang.String
useKeepShareLockClause
protected static java.lang.String
useKeepUpdateLockClause
static java.lang.String
VENDOR_IBM
protected static java.lang.String
withCSClause
protected static java.lang.String
withRRClause
protected static java.lang.String
withRSClause
protected static java.lang.String
withURClause
-
Fields inherited from class org.apache.openjpa.jdbc.sql.AbstractDB2Dictionary
varcharCastLength
-
Fields inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
_procs, _proxyManager, allowQueryTimeoutOnFindUpdate, allowsAliasInBulkClause, arrayTypeName, autoAssignClause, autoAssignTypeName, batchLimit, bigintTypeName, binaryTypeName, bitLengthFunction, bitTypeName, blobBufferSize, blobTypeName, booleanRepresentation, booleanTypeName, castFunction, catalogSeparator, CENTI, characterColumnSize, charTypeName, clobBufferSize, clobTypeName, closePoolSQL, concatenateDelimiter, concatenateFunction, conf, connected, CONS_NAME_AFTER, CONS_NAME_BEFORE, CONS_NAME_MID, constraintNameMode, createPrimaryKeys, crossJoinClause, currentDateFunction, currentTimeFunction, currentTimestampFunction, databaseProductName, databaseProductVersion, dateFractionDigits, datePrecision, dateTypeName, DECI, decimalTypeName, defaultSchemaName, delimitedCase, disableAlterSeqenceIncrementBy, disableSchemaFactoryColumnTypeErrors, distinctCountColumnSeparator, distinctTypeName, doubleTypeName, driverVendor, dropTableSQL, fixedSizeTypeNames, fixedSizeTypeNameSet, floatTypeName, forUpdateClause, fractionalTypeNameSet, fullResultCollectionInOrderByRelation, getStringVal, inClauseLimit, indexPhysicalForeignKeys, initializationSQL, innerJoinClause, integerTypeName, invalidColumnWordSet, isJDBC3, isJDBC4, javaObjectTypeName, javaToDbColumnNameProcessing, joinSyntax, lastGeneratedKeyQuery, leadingDelimiter, log, longVarbinaryTypeName, longVarcharTypeName, maxAutoAssignNameLength, maxColumnNameLength, maxConstraintNameLength, maxEmbeddedBlobSize, maxEmbeddedClobSize, maxIndexesPerTable, maxIndexNameLength, maxTableNameLength, MICRO, MILLI, NAME_ANY, NAME_SEQUENCE, NAME_TABLE, nameConcatenator, NANO, nativeSequenceType, nextSequenceQuery, NO_BATCH, nullTypeName, numericTypeName, otherTypeName, outerJoinClause, platform, RANGE_POST_DISTINCT, RANGE_POST_LOCK, RANGE_POST_SELECT, RANGE_PRE_DISTINCT, rangePosition, realTypeName, refTypeName, reportsSuccessNoInfoOnBatchUpdates, requiresAliasForSubselect, requiresAutoCommitForMetaData, requiresCastForComparisons, requiresCastForMathFunctions, requiresConditionForCrossJoin, requiresSearchStringEscapeForLike, requiresTargetForDelete, reservedWords, reservedWordSet, roundTimeToMillisec, SCHEMA_CASE_LOWER, SCHEMA_CASE_PRESERVE, SCHEMA_CASE_UPPER, schemaCase, searchStringEscape, SEC, selectWords, selectWordSet, sequenceNameSQL, sequenceSchemaSQL, sequenceSQL, setStringRightTruncationOn, simulateLocking, smallintTypeName, sqlStateCodes, storageLimitationsFatal, storeCharsAsNumbers, storeLargeNumbersAsStrings, stringLengthFunction, structTypeName, substringFunctionName, supportsAlterTableWithAddColumn, supportsAlterTableWithDropColumn, supportsAutoAssign, supportsCascadeDeleteAction, supportsCascadeUpdateAction, supportsCaseConversionForLob, supportsComments, supportsCorrelatedSubselect, supportsDefaultDeleteAction, supportsDefaultUpdateAction, supportsDeferredConstraints, supportsDelimitedIdentifiers, supportsForeignKeys, supportsForeignKeysComposite, supportsGeneralCaseExpression, supportsGetGeneratedKeys, supportsHaving, supportsLockingWithDistinctClause, supportsLockingWithInnerJoin, supportsLockingWithMultipleTables, supportsLockingWithOrderClause, supportsLockingWithOuterJoin, supportsLockingWithSelectRange, supportsModOperator, supportsMultipleNontransactionalResultSets, supportsNullDeleteAction, supportsNullTableForGetColumns, supportsNullTableForGetImportedKeys, supportsNullTableForGetIndexInfo, supportsNullTableForGetPrimaryKeys, supportsNullUniqueColumn, supportsNullUpdateAction, supportsParameterInSelect, supportsQueryTimeout, supportsRestrictDeleteAction, supportsRestrictUpdateAction, supportsSchemaForGetColumns, supportsSchemaForGetTables, supportsSelectEndIndex, supportsSelectForUpdate, supportsSelectFromFinalTable, supportsSelectStartIndex, supportsSimpleCaseExpression, supportsSubselect, supportsUniqueConstraints, supportsXMLColumn, systemSchemas, systemSchemaSet, systemTables, systemTableSet, tableForUpdateClause, tableLengthIncludesSchema, tableTypes, timestampTypeName, timestampWithZoneTypeName, timeTypeName, timeWithZoneTypeName, tinyintTypeName, toLowerCaseFunction, toUpperCaseFunction, trailingDelimiter, trimBothFunction, trimLeadingFunction, trimSchemaName, trimStringColumns, trimTrailingFunction, typeModifierSet, UNLIMITED, useGetBestRowIdentifierForPrimaryKeys, useGetBytesForBlobs, useGetObjectForBlobs, useGetStringForClobs, useJDBC4SetBinaryStream, useNativeSequenceCache, useSchemaName, useSetBytesForBlobs, useSetStringForClobs, useWildCardForCount, validationSQL, varbinaryTypeName, varcharTypeName, VENDOR_DATADIRECT, VENDOR_OTHER, xmlTypeEncoding, xmlTypeName
-
Fields inherited from interface org.apache.openjpa.jdbc.sql.JoinSyntaxes
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL
-
-
Constructor Summary
Constructors Constructor Description DB2Dictionary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
addCastAsType(java.lang.String func, Val val)
add CAST for a function operator where operand is a paramvoid
appendCast(SQLBuffer buf, FilterValue val, int type)
Cast the specified value to the specified type.protected void
appendLength(SQLBuffer buf, int type)
protected void
appendSelect(SQLBuffer selectSQL, java.lang.Object alias, Select sel, int idx)
Appendelem
toselectSQL
.protected void
appendSelectRange(SQLBuffer buf, long start, long end, boolean subselect)
If this dictionary can select ranges, use this method to append the range SQL.void
appendXmlComparison(SQLBuffer buf, java.lang.String op, FilterValue lhs, FilterValue rhs, boolean lhsxml, boolean rhsxml)
If this dictionary supports XML type, use this method to append xml predicate.void
connectedConfiguration(java.sql.Connection conn)
This method is called when the dictionary first sees any connection.void
createIndexIfNecessary(Schema schema, java.lang.String table, Column pkColumn)
Create an index if necessary for some database tablesvoid
createIndexIfNecessary(Schema schema, DBIdentifier table, Column pkColumn)
java.sql.Connection
decorate(java.sql.Connection conn)
Decorate the given connection if needed.int
getBatchLimit()
Return the batch limit.byte[]
getBytes(java.sql.ResultSet rs, int column)
Convert the specified column of the SQL ResultSet to the proper java type.java.lang.String
getCastFunction(Val val, java.lang.String func)
Return the correct CAST function syntaxjava.lang.String
getCastFunction(Val val, java.lang.String func, Column col)
Return the correct CAST function syntaxint
getDB2MajorVersion()
int
getDB2MinorVersion()
int
getDb2ServerType()
java.lang.String
getDefaultSchemaName()
protected java.lang.String
getForUpdateClause(JDBCFetchConfiguration fetch, boolean isForUpdate, Select sel)
Get the update clause for the query based on the isolationLevel hints if it is for update.protected java.lang.String
getOptimizeClause(Select sel)
protected java.lang.String
getSequencesSQL(java.lang.String schemaName, java.lang.String sequenceName)
Return the SQL needed to select the list of sequences.protected java.lang.String
getSequencesSQL(DBIdentifier schemaName, DBIdentifier sequenceName)
void
indexOf(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start)
Invoke this database's indexOf function.void
insertBlobForStreamingLoad(Row row, Column col, JDBCStore store, java.lang.Object ob, Select sel)
void
insertClobForStreamingLoad(Row row, Column col, java.lang.Object ob)
boolean
isDB2ISeriesV5R3OrEarlier()
boolean
isDB2ISeriesV5R4OrEarlier()
boolean
isDB2ISeriesV5R4OrLater()
boolean
isDB2UDBV81OrEarlier()
boolean
isDB2UDBV82OrLater()
boolean
isDB2ZOSV8xOrLater()
boolean
isFatalException(int subtype, java.sql.SQLException ex)
Determine if the given SQL Exception is fatal or recoverable (such as a timeout).OpenJPAException
newStoreException(java.lang.String msg, java.sql.SQLException[] causes, java.lang.Object failed)
Return a new exception that wrapscauses
.void
setBytes(java.sql.PreparedStatement stmnt, int idx, byte[] val, Column col)
Set the given value as a parameter to the statement.void
setDate(java.sql.PreparedStatement stmnt, int idx, java.util.Date val, Column col)
Set the given date value as a parameter to the statement.protected void
setDelimitedCase(java.sql.DatabaseMetaData metaData)
void
setQueryTimeout(java.sql.PreparedStatement stmnt, int timeout)
The Type 2 JDBC Driver may throw an SQLException when provided a non- zero timeout if we're connected to Z/OS.boolean
supportsIsolationForUpdate()
Return true if the dictionary uses isolation level to compute the returned getForUpdateClause() SQL clause.boolean
supportsRandomAccessResultSet(Select sel, boolean forUpdate)
Return false if the given select requires a forward-only result set.protected SQLBuffer
toSelect(SQLBuffer select, JDBCFetchConfiguration fetch, SQLBuffer tables, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, boolean forUpdate, long start, long end, Select sel)
Combine the given components into a SELECT statement.void
updateBlob(Select sel, JDBCStore store, java.io.InputStream is)
void
updateClob(Select sel, JDBCStore store, java.io.Reader reader)
-
Methods inherited from class org.apache.openjpa.jdbc.sql.AbstractDB2Dictionary
substring
-
Methods inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
addErrorCode, appendCast, appendNumericCast, appendSize, appendUpdates, applyRange, assertSupport, calculateValue, canOuterJoin, closeDataSource, combineForeignKey, comment, comparison, configureNamingRules, convertSchemaCase, convertSchemaCase, copy, copy, deleteStream, delimitAll, endConfiguration, executeQuery, fromDBName, getAddColumnSQL, getAddForeignKeySQL, getAddPrimaryKeySQL, getAlterSequenceSQL, getArray, getAsciiStream, getBatchFetchSize, getBatchUpdateCount, getBigDecimal, getBigInteger, getBinaryStream, getBlob, getBlobObject, getBoolean, getBooleanRepresentation, getByte, getCalendar, getCatalogNameForMetadata, getCatalogNameForMetadata, getChar, getCharacterStream, getClob, getClobString, getColumnDBName, getColumnIdentifier, getColumnNameForMetadata, getColumnNameForMetadata, getColumns, getColumns, getConversionKey, getCreateIndexSQL, getCreateSequenceSQL, getCreateTableSQL, getCreateTableSQL, getDate, getDate, getDateFractionDigits, getDeclareColumnSQL, getDefaultIdentifierRule, getDeleteTableContentsSQL, getDeleteTargets, getDelimitedCase, getDelimitIdentifiers, getDouble, getDropColumnSQL, getDropForeignKeySQL, getDropIndexSQL, getDropPrimaryKeySQL, getDropSequenceSQL, getDropTableSQL, getFloat, getForeignKeyConstraintSQL, getFrom, getFromSelect, getFullIdentifier, getFullName, getFullName, getFullName, getGeneratedKey, getGeneratedKeySequenceName, getGenKeySeqName, getIdentifierConcatenator, getIdentifierDelimiter, getIdentifierRule, getIdentifierRules, getIdentityColumnName, getImportedKeys, getImportedKeys, getImportedKeys, getImportedKeys, getIndexInfo, getIndexInfo, getInt, getInvalidColumnWordSet, getIsNotNullSQL, getIsNullSQL, getJDBCType, getJDBCType, getJDBCType, getKey, getLeadingDelimiter, getLOBStream, getLocalDate, getLocalDateTime, getLocale, getLocalTime, getLog, getLong, getMajorVersion, getMarkerForInsertUpdate, getMillisecondBehavior, getMinorVersion, getNamingUtil, getNumber, getObject, getOffsetDateTime, getOffsetTime, getPlaceholderValueString, getPreferredType, getPrimaryKeyConstraintSQL, getPrimaryKeys, getPrimaryKeys, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getPrimaryKeysFromGetPrimaryKeys, getRef, getSchemaCase, getSchemaNameForMetadata, getSchemaNameForMetadata, getSelectOperation, getSelects, getSelectTableAliases, getSequence, getSequences, getSequences, getShort, getStoredProcedure, getString, getSupportsDelimitedIdentifiers, getSupportsXMLColumn, getTableNameForMetadata, getTableNameForMetadata, getTables, getTables, getTime, getTimestamp, getTrailingDelimiter, getTrimSchemaName, getTypeName, getTypeName, getUniqueConstraintSQL, getValidColumnName, getValidColumnName, getValidColumnName, getValidColumnName, getValidForeignKeyName, getValidForeignKeyName, getValidIndexName, getValidIndexName, getValidPrimaryKeyName, getValidSequenceName, getValidSequenceName, getValidTableName, getValidTableName, getValidUniqueName, getValidUniqueName, getVersionColumn, getVersionColumn, getWhere, getXMLTypeEncoding, handleWarning, insertSize, isImplicitJoin, isSelect, isSystemIndex, isSystemIndex, isSystemSequence, isSystemSequence, isSystemSequence, isSystemTable, isSystemTable, isUsingLimit, isUsingOffset, isUsingOrderBy, isUsingRange, makeNameValid, makeNameValid, makeNameValid, makeNameValid, matchErrorState, mathFunction, needsToCreateIndex, needsToCreateIndex, newColumn, newForeignKey, newIndex, newPrimaryKey, newSequence, newTable, prepareStatement, processDBColumnName, putBytes, putChars, putString, refSchemaComponents, serialize, setArray, setAsciiStream, setBatchLimit, setBigDecimal, setBigInteger, setBinaryStream, setBlob, setBlobObject, setBoolean, setBooleanRepresentation, setByte, setCalendar, setChar, setCharacterStream, setClob, setClobString, setConfiguration, setDate, setDateMillisecondBehavior, setDefaultSchemaName, setDelimitIdentifiers, setDouble, setFloat, setInt, setJoinSyntax, setLeadingDelimiter, setLocalDate, setLocalDateTime, setLocale, setLocalTime, setLong, setMajorVersion, setMinorVersion, setNull, setNumber, setObject, setOffsetDateTime, setOffsetTime, setRef, setShort, setStatementQueryTimeout, setString, setSupportsDelimitedIdentifiers, setSupportsXMLColumn, setTime, setTimeouts, setTimeouts, setTimestamp, setTrailingDelimiter, setTrimSchemaName, setTyped, setUnknown, setUnknown, setXMLTypeEncoding, shorten, startConfiguration, storageWarning, supportsDeferredForeignKeyConstraints, supportsDeferredUniqueConstraints, supportsDeleteAction, supportsLocking, supportsUpdateAction, toBulkOperation, toDBName, toDBName, toDelete, toNativeJoin, toOperation, toOperation, toSelect, toSelect, toSelect, toSelect, toSelectCount, toSnakeCase, toSQL92Join, toTraditionalJoin, toUpdate, validateBatchProcess, validateDBSpecificBatchProcess, versionEqualOrEarlierThan, versionEqualOrLaterThan, versionLaterThan
-
-
-
-
Field Detail
-
VENDOR_IBM
public static final java.lang.String VENDOR_IBM
- See Also:
- Constant Field Values
-
optimizeClause
public java.lang.String optimizeClause
-
rowClause
public java.lang.String rowClause
-
db2ServerType
protected int db2ServerType
-
db2ISeriesV5R3OrEarlier
public static final int db2ISeriesV5R3OrEarlier
- See Also:
- Constant Field Values
-
db2UDBV81OrEarlier
public static final int db2UDBV81OrEarlier
- See Also:
- Constant Field Values
-
db2ZOSV8xOrLater
public static final int db2ZOSV8xOrLater
- See Also:
- Constant Field Values
-
db2UDBV82OrLater
public static final int db2UDBV82OrLater
- See Also:
- Constant Field Values
-
db2ISeriesV5R4OrLater
public static final int db2ISeriesV5R4OrLater
- See Also:
- Constant Field Values
-
forUpdate
protected static final java.lang.String forUpdate
- See Also:
- Constant Field Values
-
withURClause
protected static final java.lang.String withURClause
- See Also:
- Constant Field Values
-
withCSClause
protected static final java.lang.String withCSClause
- See Also:
- Constant Field Values
-
withRSClause
protected static final java.lang.String withRSClause
- See Also:
- Constant Field Values
-
withRRClause
protected static final java.lang.String withRRClause
- See Also:
- Constant Field Values
-
useKeepShareLockClause
protected static final java.lang.String useKeepShareLockClause
- See Also:
- Constant Field Values
-
useKeepUpdateLockClause
protected static final java.lang.String useKeepUpdateLockClause
- See Also:
- Constant Field Values
-
useKeepExclusiveLockClause
protected static final java.lang.String useKeepExclusiveLockClause
- See Also:
- Constant Field Values
-
forReadOnlyClause
protected static final java.lang.String forReadOnlyClause
- See Also:
- Constant Field Values
-
defaultSequenceSQL
protected static final java.lang.String defaultSequenceSQL
- See Also:
- Constant Field Values
-
appendExtendedExceptionText
public boolean appendExtendedExceptionText
-
supportsRowNum
public boolean supportsRowNum
Affirms whether this dictionary usesROWNUM
feature.ROWNUM
feature is used to constructSQL SELECT
query that uses an offset or limits the number of resultant rows.
By default, this flag is set tofalse
.
-
-
Method Detail
-
supportsRandomAccessResultSet
public boolean supportsRandomAccessResultSet(Select sel, boolean forUpdate)
Description copied from class:DBDictionary
Return false if the given select requires a forward-only result set.- Overrides:
supportsRandomAccessResultSet
in classDBDictionary
-
appendSelectRange
protected void appendSelectRange(SQLBuffer buf, long start, long end, boolean subselect)
Description copied from class:DBDictionary
If this dictionary can select ranges, use this method to append the range SQL.- Overrides:
appendSelectRange
in classDBDictionary
-
appendSelect
protected void appendSelect(SQLBuffer selectSQL, java.lang.Object alias, Select sel, int idx)
Description copied from class:DBDictionary
Appendelem
toselectSQL
.- Overrides:
appendSelect
in classDBDictionary
- Parameters:
selectSQL
- The SQLBuffer to append to.alias
- ASQLBuffer
or aString
to append.
-
getSequencesSQL
protected java.lang.String getSequencesSQL(java.lang.String schemaName, java.lang.String sequenceName)
Description copied from class:DBDictionary
Return the SQL needed to select the list of sequences.- Overrides:
getSequencesSQL
in classDBDictionary
-
getSequencesSQL
protected java.lang.String getSequencesSQL(DBIdentifier schemaName, DBIdentifier sequenceName)
- Overrides:
getSequencesSQL
in classDBDictionary
-
decorate
public java.sql.Connection decorate(java.sql.Connection conn) throws java.sql.SQLException
Description copied from class:DBDictionary
Decorate the given connection if needed. Some databases require special handling for JDBC bugs. This implementation issues anyDBDictionary.initializationSQL
that has been set for the dictionary but does not decorate the connection.- Specified by:
decorate
in interfaceConnectionDecorator
- Overrides:
decorate
in classDBDictionary
- Throws:
java.sql.SQLException
-
connectedConfiguration
public void connectedConfiguration(java.sql.Connection conn) throws java.sql.SQLException
Description copied from class:DBDictionary
This method is called when the dictionary first sees any connection. It is used to initialize dictionary metadata if needed. If you override this method, be sure to callsuper.connectedConfiguration
.- Overrides:
connectedConfiguration
in classDBDictionary
- Throws:
java.sql.SQLException
-
supportsIsolationForUpdate
public boolean supportsIsolationForUpdate()
Description copied from class:DBDictionary
Return true if the dictionary uses isolation level to compute the returned getForUpdateClause() SQL clause.- Overrides:
supportsIsolationForUpdate
in classDBDictionary
-
getForUpdateClause
protected java.lang.String getForUpdateClause(JDBCFetchConfiguration fetch, boolean isForUpdate, Select sel)
Get the update clause for the query based on the isolationLevel hints if it is for update. It also handles the UR hint when it is not for update.- Overrides:
getForUpdateClause
in classDBDictionary
-
isDB2UDBV82OrLater
public boolean isDB2UDBV82OrLater()
-
isDB2ZOSV8xOrLater
public boolean isDB2ZOSV8xOrLater()
-
isDB2ISeriesV5R3OrEarlier
public boolean isDB2ISeriesV5R3OrEarlier()
-
isDB2ISeriesV5R4OrLater
public boolean isDB2ISeriesV5R4OrLater()
-
isDB2ISeriesV5R4OrEarlier
public boolean isDB2ISeriesV5R4OrEarlier()
-
isDB2UDBV81OrEarlier
public boolean isDB2UDBV81OrEarlier()
-
getOptimizeClause
protected java.lang.String getOptimizeClause(Select sel)
-
newStoreException
public OpenJPAException newStoreException(java.lang.String msg, java.sql.SQLException[] causes, java.lang.Object failed)
Description copied from class:DBDictionary
Return a new exception that wrapscauses
. However, the details of exactly what type of exception is returned can be determined by the implementation. This may take into account DB-specific exception information incauses
.- Overrides:
newStoreException
in classDBDictionary
-
getDb2ServerType
public int getDb2ServerType()
-
appendLength
protected void appendLength(SQLBuffer buf, int type)
- Overrides:
appendLength
in classDBDictionary
-
appendXmlComparison
public void appendXmlComparison(SQLBuffer buf, java.lang.String op, FilterValue lhs, FilterValue rhs, boolean lhsxml, boolean rhsxml)
If this dictionary supports XML type, use this method to append xml predicate.- Overrides:
appendXmlComparison
in classDBDictionary
- Parameters:
buf
- the SQL buffer to write the comparisonop
- the comparison operation to performlhs
- the left hand side of the comparisonrhs
- the right hand side of the comparisonlhsxml
- indicates whether the left operand maps to xmlrhsxml
- indicates whether the right operand maps to xml
-
addCastAsType
public java.lang.String addCastAsType(java.lang.String func, Val val)
add CAST for a function operator where operand is a param- Overrides:
addCastAsType
in classDBDictionary
- Parameters:
func
- function nameval
- type- Returns:
- updated string (func)
-
getBatchLimit
public int getBatchLimit()
Return the batch limit. If the batchLimit is -1, change it to 100 for best performance- Overrides:
getBatchLimit
in classDBDictionary
-
getCastFunction
public java.lang.String getCastFunction(Val val, java.lang.String func)
Return the correct CAST function syntax- Overrides:
getCastFunction
in classDBDictionary
- Parameters:
val
- operand of castfunc
- original string- Returns:
- a String with the correct CAST function syntax
-
getCastFunction
public java.lang.String getCastFunction(Val val, java.lang.String func, Column col)
Return the correct CAST function syntax- Overrides:
getCastFunction
in classDBDictionary
- Parameters:
val
- operand of castfunc
- original stringcol
- database column- Returns:
- a String with the correct CAST function syntax
-
indexOf
public void indexOf(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start)
Description copied from class:DBDictionary
Invoke this database's indexOf function.- Overrides:
indexOf
in classAbstractDB2Dictionary
- Parameters:
buf
- the SQL buffer to write the indexOf invocation tostr
- a query value representing the target stringfind
- a query value representing the search stringstart
- a query value representing the start index, or null to start at the beginning
-
appendCast
public void appendCast(SQLBuffer buf, FilterValue val, int type)
Cast the specified value to the specified type.- Parameters:
buf
- the buffer to append the cast toval
- the value to casttype
- the type of the case, e.g.Types.NUMERIC
-
createIndexIfNecessary
public void createIndexIfNecessary(Schema schema, java.lang.String table, Column pkColumn)
Create an index if necessary for some database tables- Overrides:
createIndexIfNecessary
in classDBDictionary
-
createIndexIfNecessary
public void createIndexIfNecessary(Schema schema, DBIdentifier table, Column pkColumn)
- Overrides:
createIndexIfNecessary
in classDBDictionary
-
isFatalException
public boolean isFatalException(int subtype, java.sql.SQLException ex)
Description copied from class:DBDictionary
Determine if the given SQL Exception is fatal or recoverable (such as a timeout). This implementation always returns true (i.e. all exceptions are fatal). The current dictionary implementation can overwrite this method to mark certain exception conditions as recoverable error.- Overrides:
isFatalException
in classDBDictionary
- Parameters:
subtype
- A constant indicating the category of error as defined inStoreException
.ex
- original SQL Exception as raised by the database driver.- Returns:
- false if the error is fatal.
-
setDelimitedCase
protected void setDelimitedCase(java.sql.DatabaseMetaData metaData)
- Overrides:
setDelimitedCase
in classDBDictionary
-
setQueryTimeout
public void setQueryTimeout(java.sql.PreparedStatement stmnt, int timeout) throws java.sql.SQLException
The Type 2 JDBC Driver may throw an SQLException when provided a non- zero timeout if we're connected to Z/OS. The SQLException should be logged but not thrown.- Overrides:
setQueryTimeout
in classDBDictionary
timeout
- in milliseconds- Throws:
java.sql.SQLException
-
setBytes
public void setBytes(java.sql.PreparedStatement stmnt, int idx, byte[] val, Column col) throws java.sql.SQLException
Set the given value as a parameter to the statement.- Overrides:
setBytes
in classDBDictionary
- Throws:
java.sql.SQLException
-
getBytes
public byte[] getBytes(java.sql.ResultSet rs, int column) throws java.sql.SQLException
Convert the specified column of the SQL ResultSet to the proper java type.- Overrides:
getBytes
in classDBDictionary
- Throws:
java.sql.SQLException
-
insertBlobForStreamingLoad
public void insertBlobForStreamingLoad(Row row, Column col, JDBCStore store, java.lang.Object ob, Select sel) throws java.sql.SQLException
- Overrides:
insertBlobForStreamingLoad
in classDBDictionary
- Throws:
java.sql.SQLException
-
insertClobForStreamingLoad
public void insertClobForStreamingLoad(Row row, Column col, java.lang.Object ob) throws java.sql.SQLException
- Overrides:
insertClobForStreamingLoad
in classDBDictionary
- Throws:
java.sql.SQLException
-
updateBlob
public void updateBlob(Select sel, JDBCStore store, java.io.InputStream is) throws java.sql.SQLException
- Overrides:
updateBlob
in classDBDictionary
- Throws:
java.sql.SQLException
-
updateClob
public void updateClob(Select sel, JDBCStore store, java.io.Reader reader) throws java.sql.SQLException
- Overrides:
updateClob
in classDBDictionary
- Throws:
java.sql.SQLException
-
setDate
public void setDate(java.sql.PreparedStatement stmnt, int idx, java.util.Date val, Column col) throws java.sql.SQLException
Set the given date value as a parameter to the statement.- Overrides:
setDate
in classDBDictionary
- Throws:
java.sql.SQLException
-
getDB2MajorVersion
public int getDB2MajorVersion()
-
getDB2MinorVersion
public int getDB2MinorVersion()
-
getDefaultSchemaName
public java.lang.String getDefaultSchemaName()
- Overrides:
getDefaultSchemaName
in classDBDictionary
-
toSelect
protected SQLBuffer toSelect(SQLBuffer select, JDBCFetchConfiguration fetch, SQLBuffer tables, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, boolean forUpdate, long start, long end, Select sel)
Description copied from class:DBDictionary
Combine the given components into a SELECT statement.- Overrides:
toSelect
in classDBDictionary
-
-