Represents an SQL data type as required by
getTypeInfo()
.
Provides a suitable natural ordering.
This class probably shouldn't be public, but is required to be so by the
tests.
NUM_COLS
(package private) static final int NUM_COLS
autoIncrement
private final boolean autoIncrement
caseSensitive
private final boolean caseSensitive
createParams
private final String createParams
dataType
private final int dataType
distanceFromJdbcType
private final int distanceFromJdbcType
fixedPrecScale
private final boolean fixedPrecScale
literalPrefix
private final String literalPrefix
literalSuffix
private final String literalSuffix
localTypeName
private final String localTypeName
maximumScale
private final short maximumScale
minimumScale
private final short minimumScale
normalizedType
private final int normalizedType
nullable
private final short nullable
numPrecRadix
private final int numPrecRadix
precision
private final int precision
searchable
private final short searchable
sqlDataType
private final int sqlDataType
sqlDatetimeSub
private final int sqlDatetimeSub
typeName
private final String typeName
unsigned
private final boolean unsigned
compare
private int compare(int i1,
int i2)
compareTo
public int compareTo(Object o)
Comparable implementation that orders by dataType, then by how closely
the data type maps to the corresponding JDBC SQL type.
The data type values for the non-standard SQL Server types tend to have
negative numbers while the corresponding standard types have positive
numbers so utilise that in the sorting.
determineDistanceFromJdbcType
private int determineDistanceFromJdbcType()
Determine how close this type is to the corresponding JDBC type. Used in
sorting to distinguish between types that have the same
normalizedType
value.
- positive integer indicating how far away the type is from the
corresponding JDBC type, with zero being the nearest possible
match and 9 being the least
equals
public boolean equals(Object o)
hashCode
public int hashCode()
normalizeDataType
public static int normalizeDataType(int serverDataType,
boolean useLOBs)
Return a java.sql.Types
-defined type for an SQL Server specific data type.
serverDataType
- the data type, as returned by the serveruseLOBs
- whether LOB data types are used for large types
- the equivalent data type defined by
java.sql.Types
toString
public String toString()
update
public void update(ResultSet rs)
throws SQLException