|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.websphere.rsadapter.GenericDataStoreHelper
This class should be used for non supported Databases, the user has the option to override this class and make changes to the methods to make it fit the new database. values returned by the methods in this class are the default values defined by JDBC and/or X/OPEN
Field Summary | |
---|---|
protected static java.lang.String |
EOLN
|
protected java.util.HashMap |
genErrorMap
|
protected static java.lang.String |
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 | |
---|---|
GenericDataStoreHelper(java.util.Properties props)
|
Method Summary | |
---|---|
short |
calcPartitionNumber(java.lang.String fullTableName,
java.util.Properties propPartKeys)
d146350 This method allows the vendor to calculate the partition number based on the input table name and partition key properties. |
boolean |
doConnectionCleanup(java.sql.Connection conn)
This method will do clean up on the connection. |
void |
doConnectionSetup(java.sql.Connection conn)
This method allows the DataStoreHelper to set any special connection properties that are not obtained from the configuration. |
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 found in the GenericHelper HashMap the search is done in the following order: first the errorCode is searched then the SQLState. |
int |
getIsolationLevel(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
This method returns the isolation level given the Intent object. |
int |
getLockType(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
This method returns a locktype based on the input AccessIntent update hint value. |
DataStoreHelperMetaData |
getMetaData()
This method returns the DataStore helper metadata object associated with the helper |
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. |
int |
getResultSetType(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
This method returns the resultSet type given the Intent object. |
java.lang.String |
getXAExceptionContents(javax.transaction.xa.XAException x)
This method will be used to display in the trace file the contents of the XAException. |
java.lang.String |
hasLostUpdateOrDeadLockOccurred(int isoLevel,
boolean loadedForUpdate)
Should be called when storing a CMP EntityBean and pessismistic concurrency control is used. |
boolean |
isBatchUpdateSupportedWithAccessIntent(com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
This method is used to determine if Batch is supported with the given accessIntent object. |
boolean |
isConnectionError(java.sql.SQLException ex)
This method checks if the given exception is one that caused a StaleConnectionException (connection error) |
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException |
mapException(com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException e)
This method maps the SQLException contained in the input DataStoreAdapterException to a matching WebSphere sqlException if any. If there is no matched exception, the original exception is returned. If no mapping is desired, user could override this method and just return any original exception as is(without mapping) |
java.sql.SQLException |
mapException(java.sql.SQLException e)
This method maps the input SQLException to a matching WebSphere sqlException if any. If there is no matched exception, the original exception is returned. If no mapping is desired, user could override this method and just return any original exception as is(without mapping) |
int |
modifyXAFlag(int xaflag)
This method will be used modify given flag which is passed on the XA start method. |
void |
processGenericCredentials(javax.resource.spi.security.GenericCredential credential)
This method processes the Generic Credentials authentication for a specific database. |
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 returns the lock info for use by the RAS subsystem. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String resBundle
protected static final java.lang.String EOLN
protected java.util.HashMap genErrorMap
Constructor Detail |
public GenericDataStoreHelper(java.util.Properties props)
Method Detail |
public DataStoreHelperMetaData getMetaData()
getMetaData
in interface DataStoreHelper
public int getIsolationLevel(com.ibm.websphere.appprofile.accessintent.AccessIntent intent) throws javax.resource.ResourceException
getIsolationLevel
in interface DataStoreHelper
intent
- AccessIntentjavax.resource.ResourceException
- Intent
public int getResultSetType(com.ibm.websphere.appprofile.accessintent.AccessIntent intent) throws javax.resource.ResourceException
getResultSetType
in interface DataStoreHelper
intent
- AccessIntentjavax.resource.ResourceException
- AccessIntent
public int getResultSetConcurrency(com.ibm.websphere.appprofile.accessintent.AccessIntent intent) throws javax.resource.ResourceException
getResultSetConcurrency
in interface DataStoreHelper
intent
- AccessIntentjavax.resource.ResourceException
- AccessIntent
public void processGenericCredentials(javax.resource.spi.security.GenericCredential credential) throws javax.resource.ResourceException
processGenericCredentials
in interface DataStoreHelper
credential
- javax.resource.ResourceException
- public final boolean isConnectionError(java.sql.SQLException ex)
isConnectionError
in interface DataStoreHelper
ex
- - SQLExceptionpublic java.lang.String hasLostUpdateOrDeadLockOccurred(int isoLevel, boolean loadedForUpdate)
pre-conditions
hasLostUpdateOrDeadLockOccurred
in interface DataStoreHelper
isoLevel
- the isolation level used.loadedForUpdate
- true
if the CMP EntityBean
was loaded for update (eg. FOR UPDATE keywords used on SELECT).public java.lang.Class findMappingClass(java.sql.SQLException e)
Note that in the subclasses the search will be in the same order, however if non is found then the GenericHelper HashMap will be searched also.
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.
For unsupported datastores, the GenericHelper hashtabe will be the only one to be searched unless a subclass of genericDataStoreHelper is defined for the unsupported DataStore.
e
- The SQLException we need to find a mapping class forpublic final java.sql.SQLException mapException(java.sql.SQLException e)
mapException
in interface DataStoreHelper
e
- SQLExceptionpublic final com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException mapException(com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException e)
mapException
in interface DataStoreHelper
SQLException
- to be mapped.public void doConnectionSetup(java.sql.Connection conn) throws java.sql.SQLException
doConnectionSetup
in interface DataStoreHelper
conn
- java.sql.SQLException
- public boolean doConnectionCleanup(java.sql.Connection conn) throws java.sql.SQLException
doConnectionCleanup
in interface DataStoreHelper
conn
- java.sql.Connectionjava.sql.SQLException
- public void doStatementCleanup(java.sql.PreparedStatement stmt) throws java.sql.SQLException
Clean up a statement before it is placed in the cache. This method is called only for statements which are being cached. It is called only if at least one of the following statement properties has changed,
The GenericDataStoreHelper implementation for this method resets all six of the properties listed above.
The following operations do not need to be included in the statement cleanup since they are automatically performed by WebSphere when caching statements,
setFetchSize(0)
clearParameters()
clearWarnings()
A helper class implementing this method may choose to do additional cleanup for the statement. However, this should never include closing the statement, since the statement is intended to be cached.
doStatementCleanup
in interface DataStoreHelper
stmt
- the PreparedStatement.java.sql.SQLException
- if an error occurs cleaning up the statement.public java.lang.String showLockInfo(java.util.Properties props) throws java.lang.Exception
props
- properties - contains the information to connect to a databasejava.lang.Exception
- public void setUserDefinedMap(java.util.Map newmap)
setUserDefinedMap
in interface DataStoreHelper
newmap
- Map - a list of SQL error codes / states and the Exception classpublic int getLockType(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
getLockType
in interface DataStoreHelper
intent
- An AccessIntentpublic short calcPartitionNumber(java.lang.String fullTableName, java.util.Properties propPartKeys) throws javax.resource.ResourceException
Note: the subclass must implement this method if a custom data source is used.
calcPartitionNumber
in interface DataStoreHelper
fullTableName
- - the fully qualified table name.propPartKeys
- - the partition key properties-
- any exception occurs during the calculation of a partition key will result in a
ResourceExceptionpublic java.io.PrintWriter getPrintWriter()
getPrintWriter
in interface DataStoreHelper
public java.lang.String getXAExceptionContents(javax.transaction.xa.XAException x)
getXAExceptionContents
in interface DataStoreHelper
XAException
- public int modifyXAFlag(int xaflag)
modifyXAFlag
in interface DataStoreHelper
xaflag
- public boolean isBatchUpdateSupportedWithAccessIntent(com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
isBatchUpdateSupportedWithAccessIntent
in interface DataStoreHelper
accessIntent
- AccessIntent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |