Use jdbc-type="TIMESTAMP" in the repository.xml for DATE-Fields and java.util.Date will work.
If you use java.sql.Date you can only handle days and not the hours, minuts and seconds. Roland Ribi > -----Original Message----- > From: Marco Jos� [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 26, 2004 5:14 PM > To: [EMAIL PROTECTED] > Subject: ClassCastException when storing a Date > > > Hi. > > I'm working under Oracle9 and have a problem when I try to insert a > date. > I have already some data in the DB which was inserted with a > SQL Client. > When I query these data with OJB, the dates are listed in the > following > pattern: "yyyy-MM-dd". > Now when I insert a date into an object (java.util.Date) it uses the > pattern: "EEE, MMM dd HH:mm:ss Z yyyy" and therefore the > PersistenceBroker throws a ClassCastException when trying to > store this > object. > Can anybody tell me how to resolve this problem? Do I have to edit the > repository.xml file? > > > Thank you in advance, > > Marco Jos� > > > > --- This message may contain confidential information or > privileged material, and is intended only for the > individual(s) named. If you are not a named addressee you > should not disseminate, distribute or copy this e-mail. > Please notify the sender immediately by e-mail if you have > received this e-mail by mistake and delete this e-mail from > your system. E-mail transmission cannot be guaranteed to be > secure or error-free as information could be intercepted, > corrupted, lost, destroyed, arrive late or incomplete, or > contain viruses. The sender therefore does not accept > liability for any errors or omissions in the contents of this > message which arise as a result of e-mail transmission. If > verification is required please request a hard-copy version. > Critical Software. > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
