ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrew.kitc...@kattare.com
Subject Re: Locale problems?
Date Tue, 20 Mar 2007 12:46:57 GMT

Thanks for the response. I'll have a look at the example you have
suggested. I am using a date jdbc type for the date field as I only
need dates in the form yyyy-MM-dd rather than the extended datetime

Here are some more interesting things to think about:

1) I can successfully persist into the same table using other methods in
the SqlMap. Therefore the date field is successfully populated.
2) To reiterate - the code works fine in my local environment and when
connecting to the remote database.

This seems to point to the error being in the code rather than the
database. The query being run to cause the error is a very simple
select * from statement, matching on one varchar field. It uses a
resultMap, which directly maps onto a class. I can remove the resultMap
and map directly using resultClass but the same error occurs. This seems
to suggest it isn't the resultMap.

Any clues? I'm lost for ideas right now.


Quoting Larry Meadors <lmeadors@apache.org>:

> Are you using strings for dates or dates for dates?
> If you are using strings (a really bad idea, btw) you can set the
> locale on the command line when you start Java, or in code:
> http://www.exampledepot.com/egs/java.util/SetDefLocale.html
> Larry
> On 3/20/07, andrew.kitchen@kattare.com <andrew.kitchen@kattare.com>
> wrote:
> >
> > All,
> >
> > I have an application that uses SqlMaps. I have it working fine on
> my
> > local machine. I also have it working fine when I use a remote
> database
> > hosted by my service provider. I have trouble when the exact same
> > application code is then used on the server hosted by my service
> > provider. This throws an error when trying to read an object from
> the
> > database. It fails to parse the date. All dates are in the format
> > yyyy-MM-dd. My local machine is in the UK and the service
> provider's
> > server in the USA. I am wondering if there is some kind of locale
> issue
> > here that iBatis needs to take into account? Does anyone have any
> advice
> > they can give me as it is really frustratiing as I know the code
> works
> > on my local machine........
> >
> > Best regards,
> > Andrew
> >
> >
> >
> >
> >

View raw message