Re: BeanUtils populate failing with date field ...

This is a discussion on Re: BeanUtils populate failing with date field ... within the JDBC JAVA forums in Framework and Interface Programming category; On Thu, 16 Sep 2004 12:16:54 -0700, Robert Bowen wrote: > I have been searching the lists for this ... I've come up with lots of > info but I can't quite get this to work. I thought it would be simple but > then, things just never are. > > I have a postgresql 7.5 database in Win2000, and it now accepts european > date format (dd/mm/yyyy). I had to change the "date_format" in the > postgresql.conf. > The default date format for postgresql, it seems is "yyyy-mm-dd" > > But I can't get the commons BeanUtils to swallow ...

Go Back   Application Development Forum > Framework and Interface Programming > JDBC JAVA

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 10-31-2004, 03:17 PM
Chuck Simpson
Guest
 
Default Re: BeanUtils populate failing with date field ...

On Thu, 16 Sep 2004 12:16:54 -0700, Robert Bowen wrote:

> I have been searching the lists for this ... I've come up with lots of
> info but I can't quite get this to work. I thought it would be simple but
> then, things just never are.
>
> I have a postgresql 7.5 database in Win2000, and it now accepts european
> date format (dd/mm/yyyy). I had to change the "date_format" in the
> postgresql.conf.
> The default date format for postgresql, it seems is "yyyy-mm-dd"
>
> But I can't get the commons BeanUtils to swallow a date in european
> format. It will only accept "yyyy-mm-dd", just like postgresql used to.
> This strikes me as odd. I know I have to use ConvertUtils to ... register
> a new date type but I can't figure out how.
>
> Can someone give me a brief "how to" or a link to one?
>
> Many thanks!
> syg


Use the to_date(string, format) or to_timestamp(string format) in
your query to convert your date string by specifying a date format
string that matches it, eg to_date('31/10/2004','DD/MM/YYYY').

Chuck

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:51 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.