From: | "Scott Muir" <wsmuir(at)islandnet(dot)com> |
---|---|
To: | <pgsql-interfaces(at)postgresql(dot)org> |
Subject: | FW: (repost) using null value timestamps |
Date: | 2001-08-16 22:41:11 |
Message-ID: | NCBBKLMCJOGCLFHOFECNAECOECAA.wsmuir@islandnet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
anyone?
Scott.
-----Original Message-----
From: pgsql-interfaces-owner(at)postgresql(dot)org
[mailto:pgsql-interfaces-owner(at)postgresql(dot)org]On Behalf Of Scott Muir
Sent: August 13, 2001 7:17 PM
To: pgsql-interfaces(at)postgresql(dot)org
Subject: [INTERFACES] using null value timestamps
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.
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
From | Date | Subject | |
---|---|---|---|
Next Message | tamsin | 2001-08-17 07:12:16 | RE: (repost) using null value timestamps |
Previous Message | Ashley Clark | 2001-08-16 18:09:13 | ODBC merge module for Microsoft Installer |