|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.websphere.rsadapter.GenericDataStoreHelper | +--com.ibm.websphere.rsadapter.DB2DataStoreHelper
This is a helper class customized for the DB2 database. It allows us to plug in data store specific functions. When trying to map an exception, the db2 errormap will be searched first then the generic one will be searched.
If you have any special DB2 requirements, you might want to look into extending this class and overwriting the methods you wish to change.
Field Summary | |
---|---|
protected static com.ibm.ejs.ras.TraceComponent |
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 | |
---|---|
DB2DataStoreHelper(java.util.Properties props)
Ctor does not do anything with the props argument. |
Method Summary | |
---|---|
void |
doStatementCleanup(java.sql.PreparedStatement stmt)
Clean up a statement before it is placed in the cache. |
java.lang.Class |
findMappingClass(java.sql.SQLException e)
This method returns mapping for a given exception if one is found. |
int |
getIsolationLevel(com.ibm.websphere.appprofile.accessintent.AccessIntent aIntent)
This method returns the isolation level given the Intent object. |
java.io.PrintWriter |
getPrintWriter()
This method is used to get the printWriter to be used to output jdbc logging when database logging is enabled (e.g. |
int |
getResultSetConcurrency(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
This method returns the resultSet concurrency given the Intent Object. |
boolean |
isBatchUpdateSupportedWithAccessIntent(com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
This method is used to determine if Batch is supported with the given accessIntent object. |
void |
setUserDefinedMap(java.util.Map newmap)
This method is used to add user defined error maps. |
java.lang.String |
showLockInfo(java.util.Properties props)
This method creates lock information for DB2. |
Methods inherited from class com.ibm.websphere.rsadapter.GenericDataStoreHelper |
---|
calcPartitionNumber, doConnectionCleanup, doConnectionSetup, getLockType, getMetaData, getResultSetType, getXAExceptionContents, hasLostUpdateOrDeadLockOccurred, isConnectionError, mapException, mapException, modifyXAFlag, processGenericCredentials |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final com.ibm.ejs.ras.TraceComponent db2Tc
Constructor Detail |
public DB2DataStoreHelper(java.util.Properties props)
props
- is ignoredMethod Detail |
public void doStatementCleanup(java.sql.PreparedStatement stmt) throws java.sql.SQLException
doStatementCleanup
in class GenericDataStoreHelper
stmt
- the PreparedStatement.java.sql.SQLException
- if an error occurs cleaning up the statement.public final java.lang.Class findMappingClass(java.sql.SQLException e)
If a user wants to override the mapping of a specific Exception, they can override this method and either return the same exception class or return null. In the mapexception() which calls this method if the map found is null then the original exception is returned. A user can also cancel the mapping by returning null for that exception map.
findMappingClass
in class GenericDataStoreHelper
e
- The SQLException we need to find a mapping class forpublic final int getIsolationLevel(com.ibm.websphere.appprofile.accessintent.AccessIntent aIntent) throws javax.resource.ResourceException
AccessType: Optimistic --> map to RC; PessimisticRead --> map to RR
PessimisticUpdate : Update Hint Value order is:
greedy | nocollision | Exclusive |
0/1 | 0/1 | 0/1 |
when adding up the combo as an integer, for example:
Note:
we don't allow pessimistic_update_random, therefore, this assumption
is made when calculation is done
getIsolationLevel
in class GenericDataStoreHelper
aIntent
- AccessIntentjavax.resource.ResourceException
- Intent
public int getResultSetConcurrency(com.ibm.websphere.appprofile.accessintent.AccessIntent intent) throws javax.resource.ResourceException
getResultSetConcurrency
in class GenericDataStoreHelper
intent
- AccessIntentjavax.resource.ResourceException
- AccessIntent
public final java.lang.String showLockInfo(java.util.Properties props) throws java.lang.Exception
showLockInfo
in class GenericDataStoreHelper
props
- Props should have the following data to establish a connection with DB2:java.lang.Exception
- Could range from java.io exceptions to javax.sql exceptions since we are running operations
against the OSpublic final void setUserDefinedMap(java.util.Map newmap)
setUserDefinedMap
in class GenericDataStoreHelper
newmap
- Map - a list of SQL error codes / states and the Exception classpublic java.io.PrintWriter getPrintWriter()
getPrintWriter
in class GenericDataStoreHelper
public boolean isBatchUpdateSupportedWithAccessIntent(com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
isBatchUpdateSupportedWithAccessIntent
in class GenericDataStoreHelper
accessIntent
- AccessIntent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |