org.firebirdsql.jca
Class FBTpbMapper

java.lang.Object
  extended byorg.firebirdsql.jca.FBTpbMapper
All Implemented Interfaces:
java.io.Serializable

public class FBTpbMapper
extends java.lang.Object
implements java.io.Serializable

This class is provides mapping capabilities between standard JDBC transaction isolation level and Firebird Transaction Parameters Block (TPB).

Author:
Roman Rokytskyy
See Also:
Serialized Form

Field Summary
static FBTpbMapper DEFAULT_MAPPER
           
static java.lang.String DEFAULT_MAPPING_RESOURCE
           
 
Constructor Summary
FBTpbMapper()
          Create instance of this class with the default mapping of JDBC transaction isolation levels to Firebird TPB.
FBTpbMapper(java.util.Map stringMapping)
          Create instance of this class for the specified string mapping.
FBTpbMapper(java.lang.String mappingResource, java.lang.ClassLoader cl)
          Create instance of this class and load mapping from the specified resource.
 
Method Summary
 java.util.Set getDefaultMapping()
          Get default mapping.
 java.util.Set getMapping(int transactionIsolation)
          Get mapping for the specified transaction isolation level.
 void setMapping(int transactionIsolation, java.util.Set tpb)
          Set mapping for the specified transaction isolation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAPPING_RESOURCE

public static final java.lang.String DEFAULT_MAPPING_RESOURCE
See Also:
Constant Field Values

DEFAULT_MAPPER

public static final FBTpbMapper DEFAULT_MAPPER
Constructor Detail

FBTpbMapper

public FBTpbMapper()
Create instance of this class with the default mapping of JDBC transaction isolation levels to Firebird TPB.


FBTpbMapper

public FBTpbMapper(java.util.Map stringMapping)
            throws FBResourceException
Create instance of this class for the specified string mapping.

Parameters:
stringMapping - mapping of JDBC transaction isolation to Firebird mapping. Keys and values of this map must be strings. Keys can have following values: Values are specified as comma-separated list of following keywords: It is also allowed to strip "isc_tpb_" prefix from above shown constans. Meaning of these constants and possible combinations you can find in a documentation.
Throws:
FBResourceException - if mapping contains incorrect values.

FBTpbMapper

public FBTpbMapper(java.lang.String mappingResource,
                   java.lang.ClassLoader cl)
            throws FBResourceException
Create instance of this class and load mapping from the specified resource.

Parameters:
mappingResource - name of the resource to load.
cl - class loader that should be used to load specified resource.
Throws:
FBResourceException - if resource cannot be loaded or contains incorrect values.
Method Detail

getMapping

public java.util.Set getMapping(int transactionIsolation)
                         throws FBResourceException
Get mapping for the specified transaction isolation level.

Parameters:
transactionIsolation - transaction isolation level.
Returns:
set with TPB parameters.
Throws:
FBResourceException - if specified transaction isolation level is unknown.

setMapping

public void setMapping(int transactionIsolation,
                       java.util.Set tpb)
                throws FBResourceException
Set mapping for the specified transaction isolation.

Parameters:
transactionIsolation - transaction isolation level.
tpb - TPB parameters.
Throws:
FBResourceException - if incorrect isolation level is specified.

getDefaultMapping

public java.util.Set getDefaultMapping()
Get default mapping. Default mapping represents a TPB mapping for the default transaction isolation level (read committed).

Returns:
mapping for the default transaction isolation level.


Copyright © 2001 David Jencks and other authors. All rights reserved.