getDate() and getTime() fails with columns of type 'TimeStamp'

Поиск
Список
Период
Сортировка
От Michael Stephenson
Тема getDate() and getTime() fails with columns of type 'TimeStamp'
Дата
Msg-id Pine.LNX.4.30.0105301636190.13426-100000@tirin.openworld.co.uk
обсуждение исходный текст
Ответ на Re: Fw: Druid problems  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: getDate() and getTime() fails with columns of type 'TimeStamp'
Список pgsql-jdbc
In org.postgresql.jdbc2.ResultSet, both getDate() and getTime() fail on
columns of type 'timestamp', which is against the jdbc spec, patch below
fixes it.

Michael Stephenson      mstephenson@openworld.co.uk
Developer   -    Web Applications    -   Open World
Tel: +44 1225 444 950         Fax: +44 1225 336 738



--- ResultSet.java.old    Wed May 30 16:32:48 2001
+++ ResultSet.java    Wed May 30 16:41:33 2001
@@ -423,6 +423,8 @@
     String s = getString(columnIndex);
     if(s==null)
       return null;
+    if (s.length() > 10)
+    return new java.sql.Date(getTimeStamp(columnIndex).getTime())

     return java.sql.Date.valueOf(s);
   }
@@ -441,6 +443,8 @@

     if(s==null)
       return null; // SQL NULL
+    if (s.length() > 8)
+    return new java.sql.Time(getTimeStamp(columnIndex).getTime());

     return java.sql.Time.valueOf(s);
   }


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Fw: Druid problems
Следующее
От: Tony Grant
Дата:
Сообщение: Re: Fw: Druid problems