Hi again, My problem is to display dates in European format.
If I use java.sql.Date in the Application class the date is displayed as: 2003-11-26 If I use java.util.Date the date is displayed as: Wed Nov 26 00:00:00 CET 2003 I would like to have the format: dd.mm.yyyy. I thought that we could define the format in OJB. I could do the conversion with Java but it's lot of work. What do you think? Thanks Regards Sylvain > -----Message d'origine----- > De: Charles Anthony [mailto:[EMAIL PROTECTED] > Date: mardi, 18. novembre 2003 10:09 > À: 'OJB Users List' > Objet: RE: Problem with dates conversion > > > Sylain, what precisely is the problem you have ? > > Cheers, > > Charles. > > > -----Original Message----- > > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > > Sent: 18 November 2003 09:11 > > To: [EMAIL PROTECTED] > > Subject: RE: Problem with dates conversion > > > > > > Hi, > > > > Yes you're right! > > > > But the conversion doesn't change anything for me. > > > > Regards > > Sylvain > > > > > -----Message d'origine----- > > > De: Charles Anthony [mailto:[EMAIL PROTECTED] > > > Date: mardi, 18. novembre 2003 09:47 > > > À: 'OJB Users List' > > > Objet: RE: Problem with dates conversion > > > > > > > > > Hi, > > > > > > Check your class. I think you'll find that > > > Application.releaseDate is a > > > java.sql.Date and *not* a java.util.Date. > > > > > > The error message is saying > > > "com.itservices.woc.data.Application has an > > > attribute releaseDate with a type of java.sql.Date, but I > > > have a value of > > > java.util.Date". > > > > > > JavaDate2SqlDateFieldConversion converts betwen jdbc dates > > > (java.sql.Date) > > > into java dates (java.util.Date) when reading from the > > datase, and the > > > reverse when writing to the database. > > > > > > Either > > > a) Don't use the conversion or > > > b) change the attribute to be java.util.Date > > > > > > Cheers, > > > > > > Charles. > > > > > > > -----Original Message----- > > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] > > > > Sent: 18 November 2003 08:43 > > > > To: [EMAIL PROTECTED] > > > > Subject: Problem with dates conversion > > > > > > > > > > > > Hello, > > > > > > > > Trying to use the field conversion: > > > > > > > > I have a class "Application" that has an attribute > > > > "releaseDate" to store a date (no time). > > > > In my database (MS SQL) the type is: datetime. > > > > In OJB repository the jdbc-type is: DATE. > > > > In my java code I use the class java.util.Date. > > > > > > > > I added the line below in OJB repository: > > > > conversion="org.apache.ojb.broker.accesslayer.conversions.Java > > > > Date2SqlDateFieldConversion" > > > > > > > > But this produces an error: > > > > > > > > [DEFAULT] ERROR: Error in operation [set] of object > > > > [PersistentFieldPropertyImpl], > java.lang.IllegalArgumentException > > > > [DEFAULT] ERROR: Declaring class > > > [com.itservices.woc.data.Application] > > > > [DEFAULT] ERROR: Property Name [releaseDate] > > > > [DEFAULT] ERROR: Property Type [java.sql.Date] > > > > [DEFAULT] ERROR: anObject was class > > > > [com.itservices.woc.data.Application] > > > > [DEFAULT] ERROR: aValue was class [java.util.Date] > > > > org.apache.ojb.broker.PersistenceBrokerException: Unable to > > > > build object instance :class com.itservices.woc.data.Application > > > > at > > > > org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.buildWi > > > > thReflection(Unknown Source) > > > > at > > > > org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readObj > > > > ectFrom(Unknown Source) > > > > at > > > > org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResu > > > > ltSet(Unknown Source) > > > > at > > > > > org.apache.ojb.broker.accesslayer.RsIterator.next(Unknown Source) > > > > etc... > > > > > > > > Could you help me? > > > > Thanks > > > > Sylvain > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > ___________________________________________________________ > > > HPD Software Ltd. - Helping Business Finance Business > > > Email terms and conditions: www.hpdsoftware.com/disclaimer > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > ___________________________________________________________ > HPD Software Ltd. - Helping Business Finance Business > Email terms and conditions: www.hpdsoftware.com/disclaimer > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]