Supported Datatypes

List of currently supported datatypes

The Database datatypes supported by SQLUnit are described below. Type classes are the names of the class used by SQLUnit to provide support for that datatype. The Type name is the name of the datatype that is used in the SQLUnit test specification. The Server is the database server for which the datatype is defined. A Server name of Any indicates global support across all databases. The Allow Input, Allows Output and Is Sortable columns indicate whether you can use these datatypes as inputs (in your param element) or as outputs (in your result specifications), and whether you can sort by columns with these datatypes (using the sort-by attribute of the resultset element).

Table 1. SQLUnit Supported Datatypes

Type ClassType NameServerAllows InputAllows OutputIs SortableWrapper for
TextTypeNTEXTMicrosoft SQL ServerNoYesNojava.io.InputStream
ClobTypeCLOBAnyNoYesNojava.sql.Clob
ClobTypeLONGVARCHARMySQLNoYesNojava.sql.Clob
ArrayTypeARRAYAnynoyesnojava.sql.Array
JavaObjectTypeJAVA_OBJECTAnyNoYesNojava.lang.Object
UnsupportedTypeDATALINKAnyNoNoNon/a
UnsupportedTypeDISTINCTAnyNoNoNon/a
UnsupportedTypeNULLAnyNoNoNon/a
UnsupportedTypeREFAnyNoNoNon/a
UnsupportedTypeSTRUCTAnyNoNoNon/a
IntegerTypeINTEGERAnyYesYesYesjava.lang.Integer
IntegerTypeSMALLINTSybase ASAYesYesYesjava.lang.Integer
BinaryTypeBINARYAnyNoYesNojava.io.InputStream
BinaryTypeLONGVARBINARYAnyNoYesNojava.io.InputStream
ByteTypeTINYINTAnyYesYesYesjava.lang.Byte
TimeTypeTIMEAnyYesYesYesjava.sql.Time
OracleCursorTypeCURSOROracleNoYesNojava.sql.ResultSet
DateTypeDATEAnyYesYesYesjava.sql.Date
LongTypeBIGINTAnyYesYesYesjava.lang.Long
ByteArrayTypeBINARYAnyNoYesNobyte[]
ByteArrayTypeVARBINARYAnyNoYesNobyte[]
BigDecimalTypeDECIMALAnyYesYesYesjava.math.BigDecimal
BigDecimalTypeNUMERICAnyYesYesYesjava.math.BigDecimal
BlobTypeBLOBAnynoyesnojava.sql.Blob
ShortTypeSMALLINT YesYesYesjava.lang.Short
OtherTypeOTHERAnyNoYesNojava.lang.Object
DoubleTypeDOUBLEAnyYesYesYesjava.lang.Double
TimestampTypeTIMESTAMPAnyYesYesYesjava.sql.Timestamp
BooleanTypeBITAnyYesYesYesjava.lang.Boolean
BooleanTypeBOOLEANAnyYesYesYesjava.lang.Boolean
StringTypeCHARAnyYesYesYesjava.lang.String
StringTypeLONGVARCHARAnyYesYesYesjava.lang.String
StringTypeVARCHARAnyYesYesYesjava.lang.String
StringTypeNCHARMicrosoft SQL ServerYesYesYesjava.lang.String
StringTypeNVARCHARMicrosoft SQL ServerYesYesYesjava.lang.String
StringTypeFIXED_CHAROracleYesYesYesjava.lang.String
FloatTypeREALAnyYesYesYesjava.lang.Float

Warning

Starting with version 4.3, the base type mappings have been slightly modified to conform with the usage recommendations from Sun Microsystems. Details of the changes are given below.

Table 2. Changes to base type mappings

Data TypeOld MappingNew Mapping
FLOATFloatType (java.lang.Float)DoubleType (java.lang.Double)
NUMERICDoubleType (java.lang.Double)BigDecimalType (java.math.BigDecimal)
VARBINARYBinaryType (java.io.InputStream)ByteArrayType (byte[])

As a result, the overrides for adaptive_server_anywhere.NUMERIC, adaptive_server_enterprise.NUMERIC, sybase_sql_server.NUMERIC, oracle.NUMERIC, postgresql.NUMERIC and mysql.FLOAT have been removed, since these mappings now conform to the corrected base type mappings.