ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Priyesh Mashelkar" <priye...@mastek.com>
Subject RE: Re: resultMap: jdbcType or dbType?
Date Sat, 06 Aug 2005 08:09:59 GMT
hi dario,
	Here is the documentation for jdbcType.	

	jdbcType
The jdbcType attribute is used to explicitly specify the database column type of the ResultSet
column that
will be used to populate the JavaBean property. Although result maps do not have the same
difficulties with
null values, specifying the type can be useful for certain mapping types such as Date properties.
Because
Java only has one Date value type and SQL databases may have many (usually at least 3), specifying
the
date may become necessary in some cases to ensure that dates (or other types) are set correctly.
Similarly,
String types may be populated by a VARCHAR, CHAR or CLOB, so specifying the type might be
needed
in those cases too (driver dependent).

	Have  this attribute for any column that can be null! The type  posted in the Java API documents
java.sql.Types.

	For more info check http://opensource.atlassian.com/confluence/oss/display/IBATIS/What+causes+an+Invalid+column+type+error+with+Oracle%3F

	This should answer your query. 

Here is an example;
	<resultMap id="SomeId" class="SomeClass">
		<result property="sequenceNumber" column="sequenceno" jdbcType="NUMERIC" nullValue="-1"/>
	
		<result property="eventDate" column="eventDate" jdbcType="DATETIME"/>
	</resultMap>

Regards,
Priyesh

-----Original Message-----
From: dario [mailto:darionis@yahoo.com]
Sent: Saturday, August 06, 2005 1:27 PM
To: user-java@ibatis.apache.org
Subject: Re: resultMap: jdbcType or dbType?



"Priyesh Mashelkar" <priyeshm@mastek.com> wrote in message
news:A8186A64C6307940AB43CFFA85397D40353006@IND-MHP1ECL001.mastek.com...
>Please check the documentation of iBATIS


i did actualy, i read it couple of times, i have right here now front of me
(printed).

i am still not sure how does this work, whether to use java.sql.Types or  db
specific types.

could anyone, please, give some example where jdbcType attribute is used.

thank you
dario






MASTEK
"Making a valuable difference"
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCO

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited,
unless specifically indicated to that effect. Mastek Limited does not accept any responsibility
or liability for it. This e-mail and attachments (if any) transmitted with it are confidential
and/or privileged and solely for the use of the intended person or entity to which it is addressed.
Any review, re-transmission, dissemination or other use of or taking of any action in reliance
upon this information by persons or entities other than the intended recipient is prohibited.
This e-mail and its attachments have been scanned for the presence of computer viruses. It
is the responsibility of the recipient to run the virus check on e-mails and attachments before
opening them. If you have received this e-mail in error, kindly delete this e-mail from all
computers.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Mime
View raw message