com.ibm.websphere.rsadapter
Class MSSQLDataStoreHelper

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

public class MSSQLDataStoreHelper
extends GenericDataStoreHelper
implements java.io.Serializable

This is a helper class customized for the SQLServer database. it should not however be used as a helper, this helper is used from with in the DataDirectDataStoreHelper, you should only use the DataDirectDataStoreHelper. Failure to do so will cause some exceptions to be thrown when calling certain methods on this helper

See Also:
Serialized Form

Field Summary
static java.lang.String[] LOCK_OWNER_TPYES
           
static java.lang.String[] LOCK_REQUEST_MODES
           
static java.lang.String[] LOCK_REQUEST_STATUSES
           
static java.lang.String[] RESOURCE_TYPES
           
 
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
MSSQLDataStoreHelper(java.util.Properties props)
          Constructor, the property is passed in case some info is needed in the future, for now this parameter is not used.
 
Method Summary
 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 intent)
          This method returns the isolation level given the Intent object.
 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 showLockInfo(java.util.Properties props)
          This method returns lock information for MS SQLServer.
 
Methods inherited from class com.ibm.websphere.rsadapter.GenericDataStoreHelper
calcPartitionNumber, doConnectionCleanup, doConnectionSetup, doStatementCleanup, getLockType, getMetaData, getPrintWriter, getXAExceptionContents, hasLostUpdateOrDeadLockOccurred, isBatchUpdateSupportedWithAccessIntent, isConnectionError, mapException, mapException, modifyXAFlag, processGenericCredentials, setUserDefinedMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_TYPES

public static final java.lang.String[] RESOURCE_TYPES

LOCK_REQUEST_STATUSES

public static final java.lang.String[] LOCK_REQUEST_STATUSES

LOCK_OWNER_TPYES

public static final java.lang.String[] LOCK_OWNER_TPYES

LOCK_REQUEST_MODES

public static final java.lang.String[] LOCK_REQUEST_MODES
Constructor Detail

MSSQLDataStoreHelper

public MSSQLDataStoreHelper(java.util.Properties props)
Constructor, the property is passed in case some info is needed in the future, for now this parameter is not used.
Parameters:
props - not used here, entry will be ignored
Method Detail

findMappingClass

public final java.lang.Class findMappingClass(java.sql.SQLException e)
This method returns mapping for a given exception if one is found. First the predefined SQLServer map is searched. There is no user defined map in this part because it is extended to obtain the actual helper. If nothing is found, the search continues in the parent class - GenericHelper. The search is done in the following order:
  1. first the errorCode is searched
  2. then the SQLState.

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.

Overrides:
findMappingClass in class GenericDataStoreHelper
Parameters:
e - The SQLException we need to find a mapping class for
Returns:
java.lang.Class - The mapped class

getIsolationLevel

public final int getIsolationLevel(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
                            throws javax.resource.ResourceException
This method returns the isolation level given the Intent object. The code in this method should never get called. We expect this method to be overwritten by the extending class. To enforce this rule, code is included such that if it is called, an exception is thrown.
Overrides:
getIsolationLevel in class GenericDataStoreHelper
Parameters:
intent -  
Returns:
Always throws an exception
Throws:
javax.resource.ResourceException -  
See Also:
Intent

getResultSetType

public int getResultSetType(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
                     throws javax.resource.ResourceException
This method returns the resultSet type given the Intent Object. The code in this method should never get called. We expect this method to be overwritten by the extending class. To enforce this rule, code is included such that if it is called, an exception is thrown.
Overrides:
getResultSetType in class GenericDataStoreHelper
Parameters:
intent -  
Returns:
Always throws an exception
Throws:
javax.resource.ResourceException -  

getResultSetConcurrency

public int getResultSetConcurrency(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
                            throws javax.resource.ResourceException
This method returns the resultSet concurrency given the Intent Object. The code in this method should never get called. We expect this method to be overwritten by the extending class. To enforce this rule, code is included such that if it is called, an exception is thrown.
Overrides:
getResultSetConcurrency in class GenericDataStoreHelper
Parameters:
intent -  
Returns:
Always throws an exception
Throws:
javax.resource.ResourceException -  

showLockInfo

public final java.lang.String showLockInfo(java.util.Properties props)
                                    throws java.lang.Exception
This method returns lock information for MS SQLServer. We depend on MS SQLServer's mechanism to generate the lock information. MS SQLServer puts this information into a result set. We extract the information from the result set and return it as a String.
Overrides:
showLockInfo in class GenericDataStoreHelper
Parameters:
props - Props should have the following data to establish a connection with MSSQLServer:
  1. user - username that has a DBA authority, default if not specified = "sa"
  2. password - default if not specified =
  3. serverName - server name where MSSQLServer DB resides
  4. portNumber - port where MSSQLServer listener is listening
    Returns:
    Output string with locking info for MSSQLServer.
    Throws:
    java.lang.Exception - Could range from java.io exceptions to javax.sql exceptions since we are running operations against the OS.