Yeah, this time you have to blame Derby... While Larry is right and this is a very silly API... Derby was wrong to allow setting NULL without specifying the type, and unfortunately you got caught using their non-standard API.
Funny how the "Java DB" is non-standard. :-) But then again, it just wouldn't be Sun if this stuff made any sense at all... Clinton On Wed, Nov 19, 2008 at 5:12 AM, Larry Meadors <[EMAIL PROTECTED]>wrote: > This is not really an issue with ibatis, it's a SQLException thrown > back by the driver. We can't fix that, just like we can't fix it with > Oracle (which does the same thing). > > This has always seemed like a totally retarded thing to me - I mean, > come on JDBC, it's NULL. It's not like I'm trying to stuff "fred" into > an integer field. NULL doesn't really have a type, so why is the > method signature like this: > > void setNull(int parameterIndex, int sqlType); // this is from > PreparedStatement > > So, you'll have to pick one of these options: > 1) use a different driver > 2) look for a way to make derby allow that > 3) patch ibatis to provide that (if it can) > > Option #3 would make this less painful in *some* cases (only where you > are using beans and not maps) and you would have to make an attempt to > infer the SQL type based on the java type of the property being mapped > as reported by the bean. > > To be honest, I have never looked into doing this because it seemed > like more work than adding :VARCHAR to the nullables in my apps. If > you want to try it, please do - and attach the changed files to a JIRA > issue. We'll see if we can get it into the next 2.x release, and also > 3.x. :-D > > Larry > > > On Wed, Nov 19, 2008 at 3:15 AM, Zsolt Koppany <[EMAIL PROTECTED]> > wrote: > > with all newer derby versions I get an Exception if I want to store NULL > > values. > > > > Derby (or ibatis) wants my application telling also the java type of the > > NULL value something like below: > > > > #value:INTEGER# > > > > We cannot modify all ibatis files and additional we should write a lot of > > new tests testing all possible NULL values. > > > > We use ibatis-2.3.4.726. > > > > How can we fix the problem? > > >
