If you set a timestamp field to be 'current' as per
http://www.ca.postgresql.org/docs/postgres/datatype-datetime.html#AEN322
jdbc chokes on selecting that value:
Bad Timestamp Format at 0 in current
at
org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java:517)
at org.postgresql.jdbc2.ResultSet.getObject(ResultSet.java:825)
So I created this patch. I'm not sure if this is correct though,
because maybe its the servers job to convert these.
*** ResultSet.java.orig Mon May 7 18:30:42 2001
--- ResultSet.java Mon May 7 18:33:38 2001
***************
*** 495,501 ****
} else if (subsecond) {
sbuf.append('0');
}
!
// could optimize this a tad to remove too many object
creations...
SimpleDateFormat df = null;
--- 495,505 ----
} else if (subsecond) {
sbuf.append('0');
}
! String string = sbuf.toString();
! if (string.equals("current"))
! return new Timestamp((new java.util.Date()).getTime());
! else if (string.equals("epoch"))
! return new Timestamp(0);
// could optimize this a tad to remove too many object
creations...
SimpleDateFormat df = null;
***************
*** 512,518 ****
}
try {
! return new Timestamp(df.parse(sbuf.toString()).getTime());
} catch(ParseException e) {
throw new PSQLException("postgresql.res.badtimestamp",new
Integer(e.getErrorOffset()),s);
}
--- 516,522 ----
}
try {
! return new Timestamp(df.parse(string).getTime());
} catch(ParseException e) {
throw new PSQLException("postgresql.res.badtimestamp",new
Integer(e.getErrorOffset()),s);
}
--
Joseph Shraibman
jks@selectacast.net
Increase signal to noise ratio. http://www.targabot.com