You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Severin Ecker <se...@gmx.at> on 2007/07/11 13:24:00 UTC

implicit parameter map and Integer

hi,

maybe i'm just being stupid, but do i have to make some special 
arrangements so that setting 'null' into a column of type INTEGER works 
(the mapped java type is java.lang.Integer). i always get an exception 
because of an unknown jdbcType (the debugger tells me that the jdbcType 
for it is 0...)

but when i use an explicit parameterMap stating both java and jdbc type 
it works.

can i avoid the need for a parameterMap or do i have to do it that way?

thanks in advance!

cheers,
severin


Re: implicit parameter map and Integer

Posted by Jeff Butler <je...@gmail.com>.
You need to specify the JDBC type in the implicit parameter map like this:

insert into foo (bar) values(#bar:INTEGER#)

See the section entitled "Inline Parameter Map Syntax" in the developer's
guide.

Jeff Butler




On 7/11/07, Severin Ecker <se...@gmx.at> wrote:
>
> hi,
>
> maybe i'm just being stupid, but do i have to make some special
> arrangements so that setting 'null' into a column of type INTEGER works
> (the mapped java type is java.lang.Integer). i always get an exception
> because of an unknown jdbcType (the debugger tells me that the jdbcType
> for it is 0...)
>
> but when i use an explicit parameterMap stating both java and jdbc type
> it works.
>
> can i avoid the need for a parameterMap or do i have to do it that way?
>
> thanks in advance!
>
> cheers,
> severin
>
>