using null value timestamps

Поиск
Список
Период
Сортировка
От Scott Muir
Тема using null value timestamps
Дата
Msg-id NCBBKLMCJOGCLFHOFECNEEPCDPAA.wsmuir@islandnet.com
обсуждение исходный текст
Список pgsql-interfaces
I have a problem with using a null value for a timestamp.  Here's a small
example of what I mean.

PreparedStatement pstmt =con.prepareStatement("UPDATE sometable SET date = ?");
pstmt.setTimestamp(1, null);
int rows = pstmt.executeUpdate();

Here's the exception that I'm getting.  It looks like I can't use nulls for
timestamps.

java.lang.NullPointerException       at java.util.Calendar.setTime(Calendar.java:882)       at
java.text.SimpleDateFormat.format(SimpleDateFormat.java:400)      at java.text.DateFormat.format(DateFormat.java:305)
   at
 
org.postgresql.jdbc2.PreparedStatement.setTimestamp(PreparedStatement.java:3
88)       at Test.update(Test.java:40);

We're using version 7.1.1 and the jdbc which comes with 7.0.3 and java 1.3,
redhat 7.1

Thanks,
Scott.




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

Предыдущее
От: "Jacob Vennervald Madsen"
Дата:
Сообщение: Re: Pgaccess on win2k
Следующее
От: Miguel Gonzalez
Дата:
Сообщение: RE: pg_hba.conf and password files