IfxLocator
Date: 2015-03-03

com.informix.jdbc

## Class IfxLocator

- java.lang.Object
- - com.informix.jdbc.IfxLocator

-     public class IfxLocator
      extends java.lang.Object

  The IfxLocator class (known as the locator pointer or large object locator) is the communication link between the database server and the client for a particular large object. Before it creates a large object or opens a large object for reading or writing, an application must create a IfxLocator object.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IfxLocator()` Creates a default IfxLocator.
    `IfxLocator(byte[] byteBuf)` Creates an IfxLocator using the byte array.
    `IfxLocator(java.sql.Connection conn)` Creates a IfxLocator.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `decRefCount()` decRefCount() decrements the reference count of this large object.
    `int` | `incRefCount()` incRefCount() increments the reference count of this large object.
    `byte[]` | `toBytes()` toBytes() This method can be used to return the locator in its raw byte[] format.
    `java.lang.String` | `toString()` toString() This method can be used to return the locator in its hexadecimal string format.

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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### IfxLocator

          public IfxLocator()

      Creates a default IfxLocator.

    - #### IfxLocator

          public IfxLocator(java.sql.Connection conn)
                     throws java.sql.SQLException

      Creates a IfxLocator.
      Parameters:
        `conn` - the java.sql.Connection object
      Throws:
        `java.sql.SQLException`

    - #### IfxLocator

          public IfxLocator(byte[] byteBuf)
                     throws java.sql.SQLException

      Creates an IfxLocator using the byte array.
      Parameters:
        `byteBuf` - the byte array containing the locator pointer
      Throws:
        `java.sql.SQLException`

  - ### Method Detail

    - #### incRefCount

          public int incRefCount()
                          throws java.sql.SQLException

      incRefCount() increments the reference count of this large object. This function is useful for manually tracking multiple references to the same smartlarge object. Typical use for this function would be in the assign() support function to increment the reference count of the new smart large object. This method is only supported in the server-side JDBC. Attempts to use this method from a client program will raise an SQLException.
      Returns:
        Reference count after the increment
      Throws:
        `java.sql.SQLException` - if there is an error or if using client JDBC

    - #### decRefCount

          public int decRefCount()
                          throws java.sql.SQLException

      decRefCount() decrements the reference count of this large object. This function is useful for manually tracking multiple references to the same smart large object. Typical use for this function would be in the destroy() support function to decrement the reference count of the new smart large object. This method is only supported in the server-side JDBC. Attempts to use this method from a client program will raise an SQLException.
      Returns:
        Reference count after the decrement
      Throws:
        `java.sql.SQLException` - if there is an error or if using client JDBC

    - #### toString

          public java.lang.String toString()

      toString() This method can be used to return the locator in its hexadecimal string format. The output is similar to the output produced by Long.toHexString(i) except that leading zeros are preserved.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the string representation of this instance's raw locator in hexadecimal (base 16).

    - #### toBytes

          public byte[] toBytes()

      toBytes() This method can be used to return the locator in its raw byte[] format.
      Returns:
        the raw locator as a byte[].