Package org.firebirdsql.gds
Class ParameterBufferHelper
- java.lang.Object
-
- org.firebirdsql.gds.ParameterBufferHelper
-
public class ParameterBufferHelper extends java.lang.Object
This class maps the extended JDBC properties to parameter buffer types (for transaction and database parameter buffers). It usesjava.lang.reflection
to determine correct type of the parameter passed to theDriver.connect(String, Properties)
method.- Version:
- 1.0
- Author:
- Roman Rokytskyy, Mark Rotteveel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ParameterBufferHelper.DpbParameterType
Dpb type, which is the name, the key for the dpb and its value type.static class
ParameterBufferHelper.DpbValueType
Enum with the various Dpb value types, and conversion from String to that type.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DPB_PREFIX
static java.lang.String
ISC_DPB_TYPES_RESOURCE
static java.lang.String
TPB_PREFIX
-
Constructor Summary
Constructors Constructor Description ParameterBufferHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.Integer
getDpbKey(java.lang.String name)
Get integer value of the DPB key corresponding to the specified name.static java.util.Map<java.lang.String,java.lang.Integer>
getDpbMap()
Get mapping between DPB names and their keys.static ParameterBufferHelper.DpbParameterType
getDpbParameterType(java.lang.String name)
Gets theParameterBufferHelper.DpbParameterType
for the specified dpb item name (short or long)static java.lang.Integer
getTpbParam(java.lang.String name)
Get value of TPB parameter for the specified name.static java.lang.Object
parseDpbString(java.lang.String name, java.lang.Object value)
Deprecated.In general,parseDpbString(String, String)
should be used; this method is not planned for removalstatic java.lang.Object
parseDpbString(java.lang.String name, java.lang.String value)
Parse string to DPB value.
-
-
-
Field Detail
-
DPB_PREFIX
public static final java.lang.String DPB_PREFIX
- See Also:
- Constant Field Values
-
TPB_PREFIX
public static final java.lang.String TPB_PREFIX
- See Also:
- Constant Field Values
-
ISC_DPB_TYPES_RESOURCE
public static final java.lang.String ISC_DPB_TYPES_RESOURCE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDpbKey
public static java.lang.Integer getDpbKey(java.lang.String name)
Get integer value of the DPB key corresponding to the specified name.- Parameters:
name
- name of the key.- Returns:
- instance of
Integer
corresponding to the specified name ornull
if value is not known.
-
getDpbParameterType
public static ParameterBufferHelper.DpbParameterType getDpbParameterType(java.lang.String name)
Gets theParameterBufferHelper.DpbParameterType
for the specified dpb item name (short or long)- Parameters:
name
- Name of the dpb item- Returns:
DpbParameterType
instance, ornull
if there is no item with this name
-
getDpbMap
public static java.util.Map<java.lang.String,java.lang.Integer> getDpbMap()
Get mapping between DPB names and their keys.- Returns:
- instance of
Map
, where key is the name of DPB parameter, value is its DPB key.
-
parseDpbString
@Deprecated public static java.lang.Object parseDpbString(java.lang.String name, java.lang.Object value)
Deprecated.In general,parseDpbString(String, String)
should be used; this method is not planned for removalParse object to DPB value.- Parameters:
name
- Name of DPB itemvalue
- Value to parse- Returns:
- Object type appropriate for this DPB type
-
parseDpbString
public static java.lang.Object parseDpbString(java.lang.String name, java.lang.String value)
Parse string to DPB value.- Parameters:
name
- Name of DPB itemvalue
- Value to parse- Returns:
- Object type appropriate for this DPB type
-
getTpbParam
public static java.lang.Integer getTpbParam(java.lang.String name)
Get value of TPB parameter for the specified name. This method tries to match string representation of the TPB parameter with its value.- Parameters:
name
- string representation of TPB parameter, can have "isc_tpb_" prefix.- Returns:
- value corresponding to the specified parameter name or
null
if nothing was found.
-
-