On Mon, Sep 18, 2000 at 07:31:56PM +0000, [EMAIL PROTECTED] wrote:
> I have an entity bean that contains a java.util.Date property. Creating
> works fine, but when I using a finder method, I get the following error:
>
> com.evermind.server.rmi.OrionRemoteException: Database error: Bad Timestamp
> Format at 19 in 2000-09-18 14:08:47.86-04; nested exception is:
> Bad Timestamp Format at 19 in 2000-09-18 14:08:47.86-04
>
> Has anyone seen this before using java.util.Date, CMP, orion and Postgres?
The problem is that a java.util.Date and a Date in Postgres is not the
same. A java.util.Date represents a moment in time (millisecond
precision), while a Date in Postgres represents a specific day (year,
month, day).
Use the Postgres type Timestamp instead and it will work. The
database-schema for Postgres distributed with Orion has java.util.Date
mapped to Date which isn't correct.
<type-mapping type="java.util.Date" name="timestamp" />
http://www.postgresql.org/users-lounge/docs/7.0/postgres/datatype1134.htm
Beware of that setting a column to new Date(0) will render it unreadable
for Java since Postgres will return the string 'epoch' for this which the
Java date parser won't recognize.
Regards, Markus.
--
Markus Holmberg | Give me Unix or give me a typewriter.
[EMAIL PROTECTED] | http://www.freebsd.org/