org.apache.openjpa.jdbc.sql
Class DB2Dictionary

java.lang.Object
  extended by org.apache.openjpa.jdbc.sql.DBDictionary
      extended by org.apache.openjpa.jdbc.sql.AbstractDB2Dictionary
          extended by 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.SerializedData
 
Field Summary
 boolean appendExtendedExceptionText
           
protected  String databaseProductName
           
protected  String databaseProductVersion
           
static int db2ISeriesV5R3OrEarlier
           
static int db2ISeriesV5R4OrLater
           
protected  int db2ServerType
           
static int db2UDBV81OrEarlier
           
static int db2UDBV82OrLater
           
static int db2ZOSV8xOrLater
           
protected static String defaultSequenceSQL
           
protected static String forReadOnlyClause
           
protected static String forUpdate
           
protected  int maj
           
protected  int min
           
 String optimizeClause
           
 String rowClause
           
(package private) static String SYSDUMMY
           
protected static String useKeepExclusiveLockClause
           
protected static String useKeepShareLockClause
           
protected static String useKeepUpdateLockClause
           
static String VENDOR_IBM
           
protected static String withCSClause
           
protected static String withRRClause
           
protected static String withRSClause
           
protected static String withURClause
           
 
Fields inherited from class org.apache.openjpa.jdbc.sql.AbstractDB2Dictionary
varcharCastLength
 
Fields inherited from class org.apache.openjpa.jdbc.sql.DBDictionary
_proxyManager, allowsAliasInBulkClause, arrayTypeName, autoAssignClause, autoAssignTypeName, batchLimit, bigintTypeName, binaryTypeName, bitLengthFunction, bitTypeName, blobBufferSize, blobTypeName, 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, datePrecision, dateTypeName, DECI, decimalTypeName, defaultSchemaName, delimitedCase, distinctCountColumnSeparator, distinctTypeName, doubleTypeName, driverVendor, dropTableSQL, fixedSizeTypeNames, fixedSizeTypeNameSet, floatTypeName, forUpdateClause, getStringVal, inClauseLimit, initializationSQL, innerJoinClause, integerTypeName, invalidColumnWordSet, isJDBC3, isJDBC4, javaObjectTypeName, 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, 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, timeTypeName, tinyintTypeName, toLowerCaseFunction, toUpperCaseFunction, trailingDelimiter, trimBothFunction, trimLeadingFunction, trimSchemaName, trimTrailingFunction, typeModifierSet, UNLIMITED, useGetBestRowIdentifierForPrimaryKeys, useGetBytesForBlobs, useGetObjectForBlobs, useGetStringForClobs, 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
DB2Dictionary()
           
 
Method Summary
 String addCastAsType(String func, Val val)
          add CAST for a function operator where operand is a param
 void 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, Object alias, Select sel, int idx)
          Append elem to selectSQL.
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, 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(Connection conn)
          This method is called when the dictionary first sees any connection.
 void createIndexIfNecessary(Schema schema, DBIdentifier table, Column pkColumn)
           
 void createIndexIfNecessary(Schema schema, String table, Column pkColumn)
          Create an index if necessary for some database tables
 Connection decorate(Connection conn)
          Decorate the given connection if needed.
 int getBatchLimit()
          Return the batch limit.
 byte[] getBytes(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getCastFunction(Val val, String func)
          Return the correct CAST function syntax
 String getCastFunction(Val val, String func, Column col)
          Return the correct CAST function syntax
 int getDB2MajorVersion()
           
 int getDB2MinorVersion()
           
 int getDb2ServerType()
           
 String getDefaultSchemaName()
           
protected  String getForUpdateClause(JDBCFetchConfiguration fetch, boolean isForUpdate, Select sel)
          Get the update clause for the query based on the updateClause and isolationLevel hints
protected  String getOptimizeClause(Select sel)
           
protected  String getSequencesSQL(DBIdentifier schemaName, DBIdentifier sequenceName)
           
protected  String getSequencesSQL(String schemaName, String sequenceName)
          Return the SQL needed to select the list of sequences.
 void indexOf(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start)
          Invoke this database's indexOf function.
 void insertBlobForStreamingLoad(Row row, Column col, JDBCStore store, Object ob, Select sel)
           
 void insertClobForStreamingLoad(Row row, Column col, Object ob)
           
 boolean isDB2ISeriesV5R3OrEarlier()
           
 boolean isDB2ISeriesV5R4OrEarlier()
           
 boolean isDB2ISeriesV5R4OrLater()
           
 boolean isDB2UDBV81OrEarlier()
           
 boolean isDB2UDBV82OrLater()
           
 boolean isDB2ZOSV8xOrLater()
           
 boolean isFatalException(int subtype, SQLException ex)
          Determine if the given SQL Exception is fatal or recoverable (such as a timeout).
 OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed)
          Return a new exception that wraps causes.
(package private)  String nullSafe(String s)
           
 void setBytes(PreparedStatement stmnt, int idx, byte[] val, Column col)
          Set the given value as a parameter to the statement.
 void setDate(PreparedStatement stmnt, int idx, Date val, Column col)
          Set the given date value as a parameter to the statement.
protected  void setDelimitedCase(DatabaseMetaData metaData)
           
 void setQueryTimeout(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.
 void updateBlob(Select sel, JDBCStore store, InputStream is)
           
 void updateClob(Select sel, JDBCStore store, 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, assertSupport, calculateValue, canOuterJoin, checkNameLength, checkNameLength, checkNameLength, 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, getByte, getCalendar, getCatalogNameForMetadata, getCatalogNameForMetadata, getChar, getCharacterStream, getClob, getClobString, getColumnDBName, getColumnIdentifier, getColumnNameForMetadata, getColumnNameForMetadata, getColumns, getColumns, getConversionKey, getCreateIndexSQL, getCreateSequenceSQL, getCreateTableSQL, getCreateTableSQL, getDate, getDate, 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, getLocale, getLog, getLong, getMarkerForInsertUpdate, getNamingUtil, getNumber, getObject, getPlaceholderValueString, getPreferredType, getPrimaryKeyConstraintSQL, getPrimaryKeys, getPrimaryKeys, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getPrimaryKeysFromGetPrimaryKeys, getRef, getSchemaCase, getSchemaNameForMetadata, getSchemaNameForMetadata, getSelectOperation, getSelects, getSelectTableAliases, getSequence, getSequences, getSequences, getShort, 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, isSelect, isSystemIndex, isSystemIndex, isSystemSequence, isSystemSequence, isSystemSequence, isSystemTable, isSystemTable, makeNameValid, makeNameValid, makeNameValid, makeNameValid, matchErrorState, mathFunction, narrow, needsToCreateIndex, needsToCreateIndex, newColumn, newForeignKey, newIndex, newPrimaryKey, newSequence, newTable, prepareStatement, putBytes, putChars, putString, refSchemaComponents, serialize, setArray, setAsciiStream, setBatchLimit, setBigDecimal, setBigInteger, setBinaryStream, setBlob, setBlobObject, setBoolean, setByte, setCalendar, setChar, setCharacterStream, setClob, setClobString, setConfiguration, setDate, setDefaultSchemaName, setDelimitIdentifiers, setDouble, setFloat, setInt, setJoinSyntax, setLeadingDelimiter, setLocale, setLong, setNull, setNumber, setObject, setRef, setShort, setStatementQueryTimeout, setString, setSupportsDelimitedIdentifiers, setSupportsXMLColumn, setTime, setTimeouts, setTimeouts, setTimestamp, setTrailingDelimiter, setTrimSchemaName, setTyped, setUnknown, setXMLTypeEncoding, shorten, startConfiguration, storageWarning, supportsDeferredForeignKeyConstraints, supportsDeferredUniqueConstraints, supportsDeleteAction, supportsLocking, supportsUpdateAction, toBulkOperation, toDBName, toDBName, toDelete, toLong, toNativeJoin, toOperation, toOperation, toSelect, toSelect, toSelect, toSelect, toSelect, toSelectCount, toSQL92Join, toTraditionalJoin, toUpdate, validateBatchProcess, validateDBSpecificBatchProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VENDOR_IBM

public static final String VENDOR_IBM
See Also:
Constant Field Values

optimizeClause

public String optimizeClause

rowClause

public 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 String forUpdate
See Also:
Constant Field Values

withURClause

protected static final String withURClause
See Also:
Constant Field Values

withCSClause

protected static final String withCSClause
See Also:
Constant Field Values

withRSClause

protected static final String withRSClause
See Also:
Constant Field Values

withRRClause

protected static final String withRRClause
See Also:
Constant Field Values

useKeepShareLockClause

protected static final String useKeepShareLockClause
See Also:
Constant Field Values

useKeepUpdateLockClause

protected static final String useKeepUpdateLockClause
See Also:
Constant Field Values

useKeepExclusiveLockClause

protected static final String useKeepExclusiveLockClause
See Also:
Constant Field Values

forReadOnlyClause

protected static final String forReadOnlyClause
See Also:
Constant Field Values

defaultSequenceSQL

protected static final String defaultSequenceSQL
See Also:
Constant Field Values

SYSDUMMY

static final String SYSDUMMY
See Also:
Constant Field Values

databaseProductName

protected String databaseProductName

databaseProductVersion

protected String databaseProductVersion

maj

protected int maj

min

protected int min

appendExtendedExceptionText

public boolean appendExtendedExceptionText
Constructor Detail

DB2Dictionary

public DB2Dictionary()
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 class DBDictionary

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 class DBDictionary

appendSelect

protected void appendSelect(SQLBuffer selectSQL,
                            Object alias,
                            Select sel,
                            int idx)
Description copied from class: DBDictionary
Append elem to selectSQL.

Overrides:
appendSelect in class DBDictionary
Parameters:
selectSQL - The SQLBuffer to append to.

getSequencesSQL

protected String getSequencesSQL(String schemaName,
                                 String sequenceName)
Description copied from class: DBDictionary
Return the SQL needed to select the list of sequences.

Overrides:
getSequencesSQL in class DBDictionary

getSequencesSQL

protected String getSequencesSQL(DBIdentifier schemaName,
                                 DBIdentifier sequenceName)
Overrides:
getSequencesSQL in class DBDictionary

decorate

public Connection decorate(Connection conn)
                    throws SQLException
Description copied from class: DBDictionary
Decorate the given connection if needed. Some databases require special handling for JDBC bugs. This implementation issues any DBDictionary.initializationSQL that has been set for the dictionary but does not decorate the connection.

Specified by:
decorate in interface ConnectionDecorator
Overrides:
decorate in class DBDictionary
Throws:
SQLException

connectedConfiguration

public void connectedConfiguration(Connection conn)
                            throws 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 call super.connectedConfiguration.

Overrides:
connectedConfiguration in class DBDictionary
Throws:
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 class DBDictionary

getForUpdateClause

protected String getForUpdateClause(JDBCFetchConfiguration fetch,
                                    boolean isForUpdate,
                                    Select sel)
Get the update clause for the query based on the updateClause and isolationLevel hints

Overrides:
getForUpdateClause in class DBDictionary

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 String getOptimizeClause(Select sel)

newStoreException

public OpenJPAException newStoreException(String msg,
                                          SQLException[] causes,
                                          Object failed)
Description copied from class: DBDictionary
Return a new exception that wraps causes. 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 in causes.

Overrides:
newStoreException in class DBDictionary

getDb2ServerType

public int getDb2ServerType()

appendLength

protected void appendLength(SQLBuffer buf,
                            int type)
Overrides:
appendLength in class DBDictionary

appendXmlComparison

public void appendXmlComparison(SQLBuffer buf,
                                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 class DBDictionary
Parameters:
buf - the SQL buffer to write the comparison
op - the comparison operation to perform
lhs - the left hand side of the comparison
rhs - the right hand side of the comparison
lhsxml - indicates whether the left operand maps to xml
rhsxml - indicates whether the right operand maps to xml

addCastAsType

public String addCastAsType(String func,
                            Val val)
add CAST for a function operator where operand is a param

Overrides:
addCastAsType in class DBDictionary
Parameters:
func - function name
val - 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 class DBDictionary

getCastFunction

public String getCastFunction(Val val,
                              String func)
Return the correct CAST function syntax

Overrides:
getCastFunction in class DBDictionary
Parameters:
val - operand of cast
func - original string
Returns:
a String with the correct CAST function syntax

getCastFunction

public String getCastFunction(Val val,
                              String func,
                              Column col)
Return the correct CAST function syntax

Overrides:
getCastFunction in class DBDictionary
Parameters:
val - operand of cast
func - original string
col - 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 class AbstractDB2Dictionary
Parameters:
buf - the SQL buffer to write the indexOf invocation to
str - a query value representing the target string
find - a query value representing the search string
start - 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 to
val - the value to cast
type - the type of the case, e.g. Types.NUMERIC

createIndexIfNecessary

public void createIndexIfNecessary(Schema schema,
                                   String table,
                                   Column pkColumn)
Create an index if necessary for some database tables

Overrides:
createIndexIfNecessary in class DBDictionary

createIndexIfNecessary

public void createIndexIfNecessary(Schema schema,
                                   DBIdentifier table,
                                   Column pkColumn)
Overrides:
createIndexIfNecessary in class DBDictionary

nullSafe

String nullSafe(String s)

isFatalException

public boolean isFatalException(int subtype,
                                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 class DBDictionary
Parameters:
subtype - A constant indicating the category of error as defined in StoreException.
ex - original SQL Exception as raised by the database driver.
Returns:
false if the error is fatal.

setDelimitedCase

protected void setDelimitedCase(DatabaseMetaData metaData)
Overrides:
setDelimitedCase in class DBDictionary

setQueryTimeout

public void setQueryTimeout(PreparedStatement stmnt,
                            int timeout)
                     throws 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 class DBDictionary
timeout - in milliseconds
Throws:
SQLException

setBytes

public void setBytes(PreparedStatement stmnt,
                     int idx,
                     byte[] val,
                     Column col)
              throws SQLException
Set the given value as a parameter to the statement.

Overrides:
setBytes in class DBDictionary
Throws:
SQLException

getBytes

public byte[] getBytes(ResultSet rs,
                       int column)
                throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

Overrides:
getBytes in class DBDictionary
Throws:
SQLException

insertBlobForStreamingLoad

public void insertBlobForStreamingLoad(Row row,
                                       Column col,
                                       JDBCStore store,
                                       Object ob,
                                       Select sel)
                                throws SQLException
Overrides:
insertBlobForStreamingLoad in class DBDictionary
Throws:
SQLException

insertClobForStreamingLoad

public void insertClobForStreamingLoad(Row row,
                                       Column col,
                                       Object ob)
                                throws SQLException
Overrides:
insertClobForStreamingLoad in class DBDictionary
Throws:
SQLException

updateBlob

public void updateBlob(Select sel,
                       JDBCStore store,
                       InputStream is)
                throws SQLException
Overrides:
updateBlob in class DBDictionary
Throws:
SQLException

updateClob

public void updateClob(Select sel,
                       JDBCStore store,
                       Reader reader)
                throws SQLException
Overrides:
updateClob in class DBDictionary
Throws:
SQLException

setDate

public void setDate(PreparedStatement stmnt,
                    int idx,
                    Date val,
                    Column col)
             throws SQLException
Set the given date value as a parameter to the statement.

Overrides:
setDate in class DBDictionary
Throws:
SQLException

getDB2MajorVersion

public int getDB2MajorVersion()

getDB2MinorVersion

public int getDB2MinorVersion()

getDefaultSchemaName

public String getDefaultSchemaName()
Overrides:
getDefaultSchemaName in class DBDictionary


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.