3.7. Supported database types for Parameter Maps and Result Maps

Table 3.5 shows the basic Supported DbTypes for Parameter Maps and Result Maps for .NET that come with the System.Data and System.Data.OracleClient assemblies. See the .NET Developer Guide section on configuring the DataMapper to work with your provider's DbTypes.

The .NET Framework data provider type of a Parameter object is inferred from the .NET Framework type of the Value of the Parameter object, or from the DbType of the Parameter object. The following table shows the inferred Parameter type based on the object passed as the Parameter value or the specified DbType. You may specify the type of a Parameter in a generic fashion by setting the DbType property of the Parameter object to a particular System.Data.DbType specific to your database.

Table 3.5. Supported DbTypes for Parameter Maps and Result Maps (.NET)

CLR TypeiBATIS supportSqlDbTypeOleDbTypeOdbcTypeOracleType
Byte[]YesBinary, Image, VarBinaryBinary, VarBinaryBinary, Image, VarBinaryRaw
BooleanYesBitBooleanBitByte
Byte-TinyInt-TinyIntByte
DateTimeYesDateTime, SmallDateTimeDateDate, DateTime, SmallDateTime, TimeDateTime
charYesNot supportedCharCharByte
DecimalYesDecimal, Money, SmallMoneyDecimal, Currency, NumericDecimal, NumericNumber
DoubleYesFloatDoubleDoubleDouble
GuidYesUniqueIdentifierGuidUniqueIdentifierRaw
Int16YesSmallIntSmallIIntSmallIntInt16
Int32YesIntIntegerIntInt32
Int64YesBigIntBigIntBigIntNumber
SingleYesRealSingleRealFloat
StringYesChar, Nchar, NVarchar, Text, VarCharChar, VarCharChar, NChar, NText, NVarChar, Text, VarCharNVarChar, VarChar
TimeSpanNoNot supportedDBTimeTimeDateTime
UInt16yesInt--UInt16
UInt32yesDecimal--UInt32
UInt64yesDecimal--Number