Class DataDirectDataStoreHelper
- java.lang.Object
-
- com.ibm.websphere.rsadapter.GenericDataStoreHelper
-
- com.ibm.websphere.rsadapter.DataDirectDataStoreHelper
-
- All Implemented Interfaces:
DataStoreHelper
- Direct Known Subclasses:
ConnectJDBCDataStoreHelper
@Deprecated public class DataDirectDataStoreHelper extends GenericDataStoreHelper
Deprecated.Please use the ConnectJDBCDataStoreHelper instead.DataDirectDataStoreHelperis used internally by other WebSphere-providedDataStoreHelperimplementations. Do not subclass this class. Do not configure any DataSources to use thisDataStoreHelperdirectly.DataDirectDataStoreHelpers contain a reference to anotherDataStoreHelperinstance specific to the database used. Note: This class and its methods can not be called or referenced directly by user applications.When mapping a
SQLException, if theSQLExceptionoriginated from the DataDirect driver, theSQLExceptionmappings from theDataDirectDataStoreHelperare searched first, otherwise the mappings from theDataStoreHelperinstance for the database are searched first. If no match is found, theSQLExceptionmappings from theGenericDataStoreHelperare searched.SQLExceptionmappings specific to theDataDirectDataStoreHelperare the following:Error Code SQL State PortableSQLExceptionsubclass2217 StaleConnectionException.class2251 StaleConnectionException.class2306 StaleConnectionException.class2310 StaleConnectionException.class2311 StaleConnectionException.class08000 StaleConnectionException.class08002 StaleConnectionException.class08004 StaleConnectionException.class08007 StaleConnectionException.class40003 Void.classS1000 Void.class
-
-
Field Summary
-
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, DERBY_HELPER, DERBY_NETWORK_SERVER_HELPER, FIRST_TIME_CALLED, GENERIC_HELPER, INFORMIX_HELPER, INFORMIX_JCC_HELPER, MSSQL_HELPER, ORACLE_10G_HELPER, ORACLE_11G_HELPER, ORACLE_HELPER, POTENTIAL_DEADLOCK, POTENTIAL_LOST_UPDATE, PROXY_DS_HELPER, SEQUELINK_HELPER, SUBJECT, SYBASE_HELPER, SYBASE11_HELPER, TX_REPEATABLE_READ_FORUPDATE, TX_SERIALIZABLE_FORUPDATE, UNDEFINED_HELPER, UNDEFINED_ISOLATOIN_LEVEL, UPDATE_ON_READONLY
-
-
Constructor Summary
Constructors Constructor Description DataDirectDataStoreHelper(java.util.Properties props)Deprecated.ThisDataDirectDataStoreHelperconstructor creates a newDataDirectDataStoreHelperbased on theDataStoreHelperproperties provided.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddoConnectionSetup(java.sql.Connection conn)Deprecated.This method configures a connection before first use.java.lang.ClassfindMappingClass(java.sql.SQLException e)Deprecated.This method locates thecom.ibm.websphere.ce.cm.PortableSQLExceptionsubclass corresponding to the specifiedSQLException, as defined by theDataDirectDataStoreHelper,GenericDataStoreHelper, database-specificDataStoreHelper, and user-definedSQLExceptionmaps.intgetIsolationLevel(AccessIntent intent)Deprecated.This method determines the default transaction isolation level.java.io.PrintWritergetPrintWriter()Deprecated.This method is used to obtain a logger writer to set on theDataSourcewhen database logging is enabled (for example:WAS.database=all=enabled).voidsetUserDefinedMap(java.util.Map newmap)Deprecated.This method configures a user-definedSQLExceptionmap that supersedes defaultSQLExceptionmappings for theDataStoreHelper.java.lang.StringshowLockInfo(java.util.Properties props)Deprecated.This method returns lock information for the database to which thisDataDirectDataStoreHelperapplies.-
Methods inherited from class com.ibm.websphere.rsadapter.GenericDataStoreHelper
calcPartitionNumber, doConnectionCleanup, doConnectionCleanupPerCloseConnection, doConnectionCleanupWithValidCheck, doConnectionSetupPerGetConnection, doConnectionSetupPerTransaction, doStatementCleanup, getLockType, getMetaData, getPasswordForUseWithTrustedContextWithAuthentication, getResultSetConcurrency, getResultSetType, getXAExceptionContents, hasLostUpdateOrDeadLockOccurred, isBatchUpdateSupportedWithAccessIntent, isConnectionError, isDuplicateKey, isTransientConnectionError, isUnsupported, mapException, modifyXAFlag, setConfig
-
-
-
-
Constructor Detail
-
DataDirectDataStoreHelper
public DataDirectDataStoreHelper(java.util.Properties props)
Deprecated.ThisDataDirectDataStoreHelperconstructor creates a newDataDirectDataStoreHelperbased on theDataStoreHelperproperties provided. All implementations inheriting from a data store helper must supply this same list of properties to their super class by invoking the constructor of their super class with the list of properties.- Parameters:
props-DataStoreHelperproperties.
-
-
Method Detail
-
findMappingClass
public final java.lang.Class findMappingClass(java.sql.SQLException e)
Deprecated.This method locates the
com.ibm.websphere.ce.cm.PortableSQLExceptionsubclass corresponding to the specifiedSQLException, as defined by theDataDirectDataStoreHelper,GenericDataStoreHelper, database-specificDataStoreHelper, and user-definedSQLExceptionmaps. Precedence and related details ofSQLExceptionmapping are described on theDataStoreHelper.setUserDefinedMapmethod, with the one exception that the contained database-specificDataStoreHelpermappings are used in place of theDataDirectDataStoreHelpermappings if theSQLExceptionoriginated in the database as opposed to the DataDirect driver.Overriding this method is one of three options you have for modifying
SQLExceptionmapping. The other two options are overriding themapExceptionmethod and invoking thesetUserDefinedMapmethod to add a user-definedSQLExceptionmap.- Overrides:
findMappingClassin classGenericDataStoreHelper- Parameters:
e- TheSQLExceptionfor which to locate acom.ibm.websphere.ce.cm.PortableSQLExceptionsubclass.- Returns:
- The
com.ibm.websphere.ce.cm.PortableSQLExceptionsubclass matching theSQLException, or null if no match was found.
-
getIsolationLevel
public int getIsolationLevel(AccessIntent intent) throws javax.resource.ResourceException
Deprecated.This method determines the default transaction isolation level. The default value forDataDirectDataStoreHelperisConnection.TRANSACTION_REPEATABLE_READ.- Specified by:
getIsolationLevelin interfaceDataStoreHelper- Overrides:
getIsolationLevelin classGenericDataStoreHelper- Parameters:
intent- always null in Liberty.- Returns:
- A transaction isolation level.
- Throws:
javax.resource.ResourceException- If a transaction isolation level cannot be determined.
-
doConnectionSetup
public void doConnectionSetup(java.sql.Connection conn) throws java.sql.SQLExceptionDeprecated.This method configures a connection before first use. This method is invoked only when a new connection to the database is created. It is not invoked when connections are reused from the connection pool.
DataDirectDataStoreHelperdoes not perform any connection setup.- Specified by:
doConnectionSetupin interfaceDataStoreHelper- Overrides:
doConnectionSetupin classGenericDataStoreHelper- Parameters:
conn- the connection to set up.- Throws:
java.sql.SQLException- if connection setup cannot be completed successfully.
-
setUserDefinedMap
public final void setUserDefinedMap(java.util.Map newmap)
Deprecated.This method configures a user-defined
SQLExceptionmap that supersedes defaultSQLExceptionmappings for theDataStoreHelper. TheDataStoreHelperimplementations provided by Liberty useSQLExceptionmaps to detect fatal connection errors, as well as other specific types of connection errors. A customDataStoreHelpercan alter the default mappings by invoking this method. Invoke this method only fromDataStoreHelperclasses subclassing this class. Do not invoke this method directly from application code.Example usage of the
setUserDefinedMapmethod:public MyCustomDataStoreHelper() { ... java.util.HashMap MyErrorMap = new java.util.HashMap(2); myErrorMap.put(-801, MyDuplicateKeyException.class); myErrorMap.put(-1015, MyStaleConnectionException.class); setUserDefinedMap(myErrorMap); ... }User-defined exception mapping takes priority over all other exception mapping done by a
DataStoreHelper.For example, assume the following exception mappings are defined:
User-defined mappings SQL State S1000: UserDefinedException Default mappings Error Code 23505: DuplicateKeyException SQL State S1000: StaleConnectionException
Given the above mappings, if a
SQLExceptionis received with SQL State S1000 and Error Code 23505, the built-inDataStoreHelperimplementations map the exception toUserDefinedException.Additionally, mapping done by the built-in
DataStoreHelpers does not include mapping by chained exceptions when no match is found for the original exception.- Specified by:
setUserDefinedMapin interfaceDataStoreHelper- Overrides:
setUserDefinedMapin classGenericDataStoreHelper- Parameters:
newmap- a mapping ofSQLExceptionSQL States and Error Codes tocom.ibm.websphere.ce.cm.PortableSQLExceptionsubclasses. The key for the Map must be aString(representing the SQL State) or anInteger(representing the Error Code). The value for the Map must be a subclass ofcom.ibm.websphere.ce.cm.PortableSQLException. User-defined subclasses are permitted, but are required to declare a public constructor accepting aSQLExceptionas the single parameter.Void.classmay also be used for the value, in which case any existing mapping for the specified SQL State or Error Code is removed.
-
getPrintWriter
public java.io.PrintWriter getPrintWriter()
Deprecated.This method is used to obtain a logger writer to set on theDataSourcewhen database logging is enabled (for example:WAS.database=all=enabled). By default, null is returned and ajava.io.PrintWriterinstance created by the container is used. You can override this method to return a differentjava.io.PrintWriterinstance instead of the default.- Specified by:
getPrintWriterin interfaceDataStoreHelper- Overrides:
getPrintWriterin classGenericDataStoreHelper- Returns:
java.io.PrintWriter.
-
showLockInfo
public java.lang.String showLockInfo(java.util.Properties props) throws java.lang.ExceptionDeprecated.This method returns lock information for the database to which this
DataDirectDataStoreHelperapplies. Thepropsparameter should consist of properties appropriate for the contained database-specificDataStoreHelper- Overrides:
showLockInfoin classGenericDataStoreHelper- Parameters:
props- properties containing information needed to connect to the database.- Returns:
- the lock information.
- Throws:
java.lang.Exception- if an error occurs while collecting the lock information.
-
-