com.ibm.websphere.rsadapter
Class DB2UniversalDataStoreHelper

java.lang.Object
  |
  +--com.ibm.websphere.rsadapter.GenericDataStoreHelper
        |
        +--com.ibm.websphere.rsadapter.DB2DataStoreHelper
              |
              +--com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper
All Implemented Interfaces:
DataStoreHelper, java.io.Serializable

public class DB2UniversalDataStoreHelper
extends DB2DataStoreHelper

DB2UniversalDataStoreHelper is a DataStoreHelper implementation customized for the DB2 Universal JDBC driver. When mapping a SQLException, the SQLException mappings from the DB2UniversalDataStoreHelper are searched first. If no match is found, the SQLException mappings from the DB2DataStoreHelper are searched. If still no match is found, the SQLException mappings from the GenericDataStoreHelper are searched. If you have additional requirements on DB2 consider subclassing this implementation.

SQLException mappings specific to the DB2UniversalDataStoreHelper are the following:

Error CodeSQL StatePortableSQLException subclass
-4499StaleConnectionException.class

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.websphere.rsadapter.DB2DataStoreHelper
db2Tc
 
Fields inherited from class com.ibm.websphere.rsadapter.GenericDataStoreHelper
EOLN, genErrorMap, resBundle
 
Fields inherited from interface com.ibm.websphere.rsadapter.DataStoreHelper
CLOUDSCAPE_HELPER, CLOUDSCAPE_NETWORK_SERVER_HELPER, CONNECTJDBC_HELPER, CUSTOM_HELPER, DATADIRECT_HELPER, DB2_390_HELPER, DB2_390_LOCAL_HELPER, DB2_400_HELPER, DB2_HELPER, DB2_UNIVERSAL_HELPER, GENERIC_HELPER, INFORMIX_HELPER, MSSQL_HELPER, ORACLE_HELPER, POTENTIAL_DEADLOCK, POTENTIAL_LOST_UPDATE, SEQUELINK_HELPER, SYBASE_HELPER, SYBASE11_HELPER, TX_REPEATABLE_READ_FORUPDATE, TX_SERIALIZABLE_FORUPDATE, UPDATE_ON_READONLY, WSCONNECTJDBC_HELPER
 
Constructor Summary
DB2UniversalDataStoreHelper(java.util.Properties props)
          This DB2UniversalDataStoreHelper constructor creates a new DB2UniversalDataStoreHelper based on the DataStoreHelper properties provided.
 
Method Summary
 int getDriverType()
          This method returns the driverType which is defined for the DB2 Universal JDBC driver.
 java.io.PrintWriter getPrintWriter()
          This method is used to obtain the log writer to set on the DataSource when database logging is enabled (for example: WAS.database=all=enabled).
 boolean isBatchUpdateSupportedWithAccessIntent(com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
          This method is used to determine if CMP Entity Beans can support batch updates with the given AccessIntent.
 
Methods inherited from class com.ibm.websphere.rsadapter.DB2DataStoreHelper
doConnectionSetup, doStatementCleanup, findMappingClass, getIsolationLevel, getLockType, getResultSetConcurrency, setUserDefinedMap, showLockInfo
 
Methods inherited from class com.ibm.websphere.rsadapter.GenericDataStoreHelper
calcPartitionNumber, doConnectionCleanup, getMetaData, getResultSetType, getXAExceptionContents, hasLostUpdateOrDeadLockOccurred, isConnectionError, mapException, mapException, modifyXAFlag, processGenericCredentials, processSQL, processSQL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB2UniversalDataStoreHelper

public DB2UniversalDataStoreHelper(java.util.Properties props)
This DB2UniversalDataStoreHelper constructor creates a new DB2UniversalDataStoreHelper based on the DataStoreHelper properties provided.

Parameters:
props - DataStoreHelper properties.
Method Detail

getPrintWriter

public java.io.PrintWriter getPrintWriter()
This method is used to obtain the log writer to set on the DataSource when database logging is enabled (for example: WAS.database=all=enabled). By default, null is returned and a java.io.PrintWriter instance created by WebSphere is used. You can override this method to return a different java.io.PrintWriter instance instead of the default.

Specified by:
getPrintWriter in interface DataStoreHelper
Overrides:
getPrintWriter in class DB2DataStoreHelper
Returns:
java.io.PrintWriter.
Since:
WAS 5.0.1

isBatchUpdateSupportedWithAccessIntent

public boolean isBatchUpdateSupportedWithAccessIntent(com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
This method is used to determine if CMP Entity Beans can support batch updates with the given AccessIntent. There are some AccessIntents (for example, WebSphere Optimistic Concurrency Control intent) for which some databases are not always capable of determining the number of updated rows. This prevents CMP Entity Beans from being able to support batch updates. In such cases, this method must return false.

DB2UniversalDataStoreHelper returns a value of true, indicating batch updates are always supported. If necessary, you may change this value by overriding this method.

Specified by:
isBatchUpdateSupportedWithAccessIntent in interface DataStoreHelper
Overrides:
isBatchUpdateSupportedWithAccessIntent in class DB2DataStoreHelper
Parameters:
accessIntent - AccessIntent
Returns:
boolean true if batching is allowed with the given AccessIntent, otherwise false.
Since:
WAS 5.0.2
See Also:
AccessIntent

getDriverType

public final int getDriverType()
This method returns the driverType which is defined for the DB2 Universal JDBC driver.

Returns:
driverType - possible value : 2 , 4
Since:
WAS 5.0.2


 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.