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 uses `java.lang.reflection` to determine correct type of the parameter passed to the `Driver.connect(String, Properties)` method.

Version:
  1.0
Author:
  Roman Rokytskyy, Mark Rotteveel

### Nested Class Summary

Nested Classes
`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
`static java.lang.String` `DPB_PREFIX`
`static java.lang.String` `ISC_DPB_TYPES_RESOURCE`
`static java.lang.String` `TPB_PREFIX`

### Constructor Summary

Constructors
Constructor and Description
`ParameterBufferHelper()`

### Method Summary

All Methods Static Methods Concrete Methods Deprecated Methods
`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 the `ParameterBufferHelper.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 removal
`static java.lang.Object` `parseDpbString(java.lang.String name, java.lang.String value)` Parse string to DPB value.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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

### Constructor Detail

#### ParameterBufferHelper

    public ParameterBufferHelper()

### 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 or `null` if value is not known.

#### getDpbParameterType

    public static ParameterBufferHelper.DpbParameterType getDpbParameterType(java.lang.String name)

Gets the `ParameterBufferHelper.DpbParameterType` for the specified dpb item name (short or long)

Parameters:
  `name` - Name of the dpb item
Returns:
  `DpbParameterType` instance, or `null` 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 removal
Parse object to DPB value.

Parameters:
  `name` - Name of DPB item
  `value` - 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 item
  `value` - 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.