Class TdsData.TypeInfo

java.lang.Object
net.sourceforge.jtds.jdbc.TdsData.TypeInfo
Enclosing class:
TdsData

private static class TdsData.TypeInfo extends Object
This class implements a descriptor for TDS data types;
Author:
Mike Hutchinson.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    The display size of the type.
    final boolean
    true if type requires TDS80 collation.
    final boolean
    true if type is a signed numeric.
    final int
    The java.sql.Types constant for this data type.
    final int
    The precision of the type.
    final int
    The size of this type or < 0 for variable sizes.
    final String
    The SQL type name.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TypeInfo(String sqlType, int size, int precision, int displaySize, boolean isSigned, boolean isCollation, int jdbcType)
    Construct a new TDS data type descriptor.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • sqlType

      public final String sqlType
      The SQL type name.
    • size

      public final int size
      The size of this type or < 0 for variable sizes.

      Special values as follows:

      1. -5 sql_variant type.
      2. -4 text, image or ntext types.
      3. -2 SQL Server 7+ long char and var binary types.
      4. -1 varchar, varbinary, null types.
    • precision

      public final int precision
      The precision of the type.

      If this is -1 precision must be calculated from buffer size eg for varchar fields.

    • displaySize

      public final int displaySize
      The display size of the type.

      -1 If the display size must be calculated from the buffer size.

    • isSigned

      public final boolean isSigned
      true if type is a signed numeric.
    • isCollation

      public final boolean isCollation
      true if type requires TDS80 collation.
    • jdbcType

      public final int jdbcType
      The java.sql.Types constant for this data type.
  • Constructor Details

    • TypeInfo

      TypeInfo(String sqlType, int size, int precision, int displaySize, boolean isSigned, boolean isCollation, int jdbcType)
      Construct a new TDS data type descriptor.
      Parameters:
      sqlType - SQL type name.
      size - Byte size for this type or < 0 for variable length types.
      precision - Decimal precision or -1
      displaySize - Printout size for this type or special values -1,-2.
      isSigned - True if signed numeric type.
      isCollation - True if type has TDS 8 collation information.
      jdbcType - The java.sql.Type constant for this type.