Обсуждение: Re: Re: [INTERFACES] Trouble with JDBC2 ResultSet.getDate()

Поиск
Список
Период
Сортировка

Re: Re: [INTERFACES] Trouble with JDBC2 ResultSet.getDate()

От
Bruce Momjian
Дата:
> Well, I didn't see the patch, but my message (probably you just
> received) points to the fact that getDate shall work on a
> timestamp column, and some kind of patch shall be applied. I
> something like this:
>
> if s.length() == 10
>  return java.sql.Date.valueOf(s)
> else do the old 7.0.3 SimpleDateFormatter stuff.
>
> *or*
>
> try {
>   return  java.sql.Date.valueOf(s)
> } catch (SQLException e) {
>   do the old SimpleDateFormatter stuff...
> }
>
> sort of... gotta go, or I'd have sent you a full patch.

Would you, please?  Thanks.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: Re: [INTERFACES] Trouble with JDBC2 ResultSet.getDate()

От
Palle Girgensohn
Дата:
Here's a patch that works fine for me.

Cheers,
Palle

Bruce Momjian wrote:
>
> > Well, I didn't see the patch, but my message (probably you just
> > received) points to the fact that getDate shall work on a
> > timestamp column, and some kind of patch shall be applied. I
> > something like this:
> >
> > if s.length() == 10
> >  return java.sql.Date.valueOf(s)
> > else do the old 7.0.3 SimpleDateFormatter stuff.
> >
> > *or*
> >
> > try {
> >   return  java.sql.Date.valueOf(s)
> > } catch (SQLException e) {
> >   do the old SimpleDateFormatter stuff...
> > }
> >
> > sort of... gotta go, or I'd have sent you a full patch.
>
> Would you, please?  Thanks.
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Вложения