Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sourceforge.jtds.jdbc
Class ParamInfo

    java.lang.Object
      |
      +--net.sourceforge.jtds.jdbc.ParamInfo

All Implemented Interfaces:
  java.lang.Cloneable

class ParamInfo
extends java.lang.Object
implements java.lang.Cloneable

This class is a descriptor for procedure and prepared statement parameters.

Version:
  $Id: ParamInfo.java,v 1.16 2005/04/25 11:47:01 alin_sinpalean Exp $
Author:
  Mike Hutchinson

Field Summary
`(package private) CharsetInfo` | `charsetInfo` Character set descriptor (if different from default)
`(package private) byte[]` | `collation` TDS 8 Collation string.
`(package private) static int` | `INPUT` Flag as an input parameter.
`(package private) boolean` | `isOutput` Parameter is an output parameter
`(package private) boolean` | `isRetVal` Parameter is used as SP return value
`(package private) boolean` | `isSet` IN parameter has been set
`(package private) boolean` | `isSetOut` OUT parameter value is set.
`(package private) boolean` | `isUnicode` Parameter should be sent as unicode
`(package private) int` | `jdbcType` JDBC type constant from java.sql.Types
`(package private) int` | `length` Length of InputStream
`(package private) int` | `markerPos` Parameter offset in target SQL statement
`(package private) java.lang.String` | `name` Formal parameter name eg @P1
`(package private) static int` | `OUTPUT` Flag as an output parameter.
`(package private) java.lang.Object` | `outValue` OUT Parameter value.
`(package private) int` | `precision` Parameter decimal precision
`(package private) static int` | `RETVAL` Flag as an return value parameter.
`(package private) int` | `scale` Parameter decimal scale
`(package private) java.lang.String` | `sqlType` SQL type name eg varchar(10)
`(package private) int` | `tdsType` Internal TDS data type
`(package private) static int` | `UNICODE` Flag as a unicode parameter.
`(package private) java.lang.Object` | `value` Current parameter value

Constructor Summary
`(package private)` | `ParamInfo(ColInfo ci, java.lang.String name, java.lang.Object value, int length)` Construct a parameter based on a result set column.
`(package private)` | `ParamInfo(int pos, boolean isUnicode)` Construct a parameter with parameter marker offset.
`(package private)` | `ParamInfo(int jdbcType, java.lang.Object value, int flags)` Construct an initialised parameter with extra attributes.
`(package private)` | `ParamInfo(java.lang.String name, int pos, boolean isRetVal, boolean isUnicode)` Construct a parameter for statement caching.

Method Summary
`(package private) void` | `clearInValue()` Clear the IN parameter value and status.
`(package private) void` | `clearOutValue()` Clear the OUT parameter value and status.
`java.lang.Object` | `clone()` Creates a shallow copy of this `ParamInfo` instance.
`(package private) byte[]` | `getBytes(java.lang.String charset)` Get the byte array value of the parameter.
`(package private) java.lang.Object` | `getOutValue()` Get the output parameter value.
`(package private) java.lang.String` | `getString(java.lang.String charset)` Get the string value of the parameter.
`private static java.lang.String` | `loadFromReader(java.io.Reader in, int length)` Create a String from a Reader stream.
`private static byte[]` | `loadFromStream(java.io.InputStream in, int length)` Load a byte array from an InputStream
`(package private) void` | `setOutValue(java.lang.Object value)` Set the OUT parameter value.

Methods inherited from class java.lang.Object
`, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait`

Field Detail

### INPUT

    static final int INPUT

  Flag as an input parameter.

### OUTPUT

    static final int OUTPUT

  Flag as an output parameter.

### RETVAL

    static final int RETVAL

  Flag as an return value parameter.

### UNICODE

    static final int UNICODE

  Flag as a unicode parameter.

### tdsType

    int tdsType

  Internal TDS data type

### jdbcType

    int jdbcType

  JDBC type constant from java.sql.Types

### name

    java.lang.String name

  Formal parameter name eg @P1

### sqlType

    java.lang.String sqlType

  SQL type name eg varchar(10)

### markerPos

    int markerPos

  Parameter offset in target SQL statement

### value

    java.lang.Object value

  Current parameter value

### precision

    int precision

  Parameter decimal precision

### scale

    int scale

  Parameter decimal scale

### length

    int length

  Length of InputStream

### isOutput

    boolean isOutput

  Parameter is an output parameter

### isRetVal

    boolean isRetVal

  Parameter is used as SP return value

### isSet

    boolean isSet

  IN parameter has been set

### isUnicode

    boolean isUnicode

  Parameter should be sent as unicode

### collation

    byte[] collation

  TDS 8 Collation string.

### charsetInfo

    CharsetInfo charsetInfo

  Character set descriptor (if different from default)

### isSetOut

    boolean isSetOut

  OUT parameter value is set.

### outValue

    java.lang.Object outValue

  OUT Parameter value.

Constructor Detail

### ParamInfo

    ParamInfo(int pos,
              boolean isUnicode)

  Construct a parameter with parameter marker offset.
  Parameters:
    `pos` - the offset of the ? symbol in the target SQL string
    `isUnicode` - `true` if the parameter is Unicode encoded

### ParamInfo

    ParamInfo(java.lang.String name,
              int pos,
              boolean isRetVal,
              boolean isUnicode)

  Construct a parameter for statement caching.
  Parameters:
    `name` - the formal name of the parameter
    `pos` - the offset of the ? symbol in the parsed SQL string
    `isRetVal` - `true` if the parameter is a return value
    `isUnicode` - `true` if the parameter is Unicode encoded

### ParamInfo

    ParamInfo(int jdbcType,
              java.lang.Object value,
              int flags)

  Construct an initialised parameter with extra attributes.
  Parameters:
    `jdbcType` - the `java.sql.Type` constant describing this type
    `value` - the initial parameter value
    `flags` - the additional attributes eg OUTPUT, RETVAL, UNICODE etc.

### ParamInfo

    ParamInfo(ColInfo ci,
              java.lang.String name,
              java.lang.Object value,
              int length)

  Construct a parameter based on a result set column.
  Parameters:
    `ci` - the column descriptor
    `name` - the name for this parameter or null
    `value` - the column data value
    `length` - the column data length

Method Detail

### getOutValue

    java.lang.Object getOutValue()
                           throws java.sql.SQLException

  Get the output parameter value.
  Returns:
    the OUT value as an `Object`
  Throws:
    `java.sql.SQLException` - if the parameter has not been set

### setOutValue

    void setOutValue(java.lang.Object value)

  Set the OUT parameter value.
  Parameters:
    `value` - The data value.

### clearOutValue

    void clearOutValue()

  Clear the OUT parameter value and status.

### clearInValue

    void clearInValue()

  Clear the IN parameter value and status.

### getString

    java.lang.String getString(java.lang.String charset)
                         throws java.io.IOException

  Get the string value of the parameter.
  Returns:
    The data value as a `String` or null.

### getBytes

    byte[] getBytes(java.lang.String charset)
              throws java.io.IOException

  Get the byte array value of the parameter.
  Returns:
    The data value as a `byte[]` or null.

### loadFromStream

    private static byte[] loadFromStream(java.io.InputStream in,
                                         int length)
                                  throws java.io.IOException

  Load a byte array from an InputStream
  Parameters:
    `in` - The InputStream to read from.
    `length` - The length of the stream.
  Returns:
    The data as a `byte[]`.
  Throws:
    `java.io.IOException` -

### loadFromReader

    private static java.lang.String loadFromReader(java.io.Reader in,
                                                   int length)
                                            throws java.io.IOException

  Create a String from a Reader stream.
  Parameters:
    `in` - The Reader object with the data.
    `length` - Number of characters to read.
  Returns:
    The data as a `String`.
  Throws:
    `java.io.IOException` -

### clone

    public java.lang.Object clone()

  Creates a shallow copy of this `ParamInfo` instance. Used by the `PreparedStatement` batching implementation to duplicate parameters.
  Overrides:
    `clone` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Generated on August 22 2007