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 Brad Balmer <bb...@gmail.com> on 2005/11/07 14:06:53 UTC
iBatis with Derby
Sorry if I should be posting this to derby's list but I was hoping that
someone here may have also run into this. My web application was running on
on MySQL with no issues. I am porting it over to now run on Derby and am
running into some issues inserting NULL values into simple VARCHAR fields.
I'm running iBatis 2.1.6 and when I try an update statement to my table I am
getting the following SQL Exception:
An attempt was made to get a data value of type 'VARCHAR' from a data value
of type '0'.
The fields I am updating allows NULL values and is declared simply as a
VARCHAR(20).
The version of Derby I'm using is 10.1.1
The reason that I'm asking on this list is since I don't have control of the
underlying set functions for setting my PreparedStatement/Statement values
maybe there was something I needed to tweak to get iBatis running with
Derby.
Thanks for any help.
Re: iBatis with Derby
Posted by Brad Balmer <bb...@gmail.com>.
Thanks Clinton. That did the trick for me.
On 11/7/05, Clinton Begin <cl...@gmail.com> wrote:
>
>
> Have you specified the jdbcType attribute for all nullable fields? If not,
> try that. It's a requirement imposed by the JDBC API (which some drivers,
> like MySQL, do fine without).
>
> Cheers,
> Clinton
>
>
> On 11/7/05, Brad Balmer <bb...@gmail.com> wrote:
> >
> > Sorry if I should be posting this to derby's list but I was hoping that
> > someone here may have also run into this. My web application was running on
> > on MySQL with no issues. I am porting it over to now run on Derby and am
> > running into some issues inserting NULL values into simple VARCHAR fields.
> >
> > I'm running iBatis 2.1.6 and when I try an update statement to my table
> > I am getting the following SQL Exception:
> > An attempt was made to get a data value of type 'VARCHAR' from a data
> > value of type '0'.
> >
> > The fields I am updating allows NULL values and is declared simply as a
> > VARCHAR(20).
> >
> > The version of Derby I'm using is 10.1.1
> >
> > The reason that I'm asking on this list is since I don't have control of
> > the underlying set functions for setting my PreparedStatement/Statement
> > values maybe there was something I needed to tweak to get iBatis running
> > with Derby.
> >
> > Thanks for any help.
> >
>
>
--
Brad Balmer
bbalmer@gmail.com
Re: iBatis with Derby
Posted by Clinton Begin <cl...@gmail.com>.
Have you specified the jdbcType attribute for all nullable fields? If not,
try that. It's a requirement imposed by the JDBC API (which some drivers,
like MySQL, do fine without).
Cheers,
Clinton
On 11/7/05, Brad Balmer <bb...@gmail.com> wrote:
>
> Sorry if I should be posting this to derby's list but I was hoping that
> someone here may have also run into this. My web application was running on
> on MySQL with no issues. I am porting it over to now run on Derby and am
> running into some issues inserting NULL values into simple VARCHAR fields.
>
> I'm running iBatis 2.1.6 and when I try an update statement to my table I
> am getting the following SQL Exception:
> An attempt was made to get a data value of type 'VARCHAR' from a data
> value of type '0'.
>
> The fields I am updating allows NULL values and is declared simply as a
> VARCHAR(20).
>
> The version of Derby I'm using is 10.1.1
>
> The reason that I'm asking on this list is since I don't have control of
> the underlying set functions for setting my PreparedStatement/Statement
> values maybe there was something I needed to tweak to get iBatis running
> with Derby.
>
> Thanks for any help.
>