Users - Problem in storing date in database

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Users - Problem in storing date in database

Sangs

Hi everybody!
I am trying to build a small application in Of-biz.
I have  a date field on a form which i wish to store in the database (derby).
However on using delegator.create(booking) , I am getting the following error:



30355 (http-0.0.0.0-8080-Processor4) [       ModelService.java:694:WARN ] [Mod
Service.makeValid] : Type conversion of field [startDate] to type [java.sql.Da
] failed for value "20-Jun-06": org.ofbiz.base.util.GeneralException: Could no
convert 20-Jun-06 to java.sql.Date:  (For input string: "Jun")
30370 (http-0.0.0.0-8080-Processor4) [       ModelService.java:694:WARN ] [Mod
Service.makeValid] : Type conversion of field [endDate] to type [java.sql.Date
failed for value "21-Jun-06": org.ofbiz.base.util.GeneralException: Could not
nvert 21-Jun-06 to java.sql.Date:  (For input string: "Jun")
30370 (http-0.0.0.0-8080-Processor4) [     RequestHandler.java:284:ERROR] Requ
t confirmBooking caused an error with the following message: [Type conversion
 field [startDate] to type [java.sql.Date] failed for value "20-Jun-06": org.o
iz.base.util.GeneralException: Could not convert 20-Jun-06 to java.sql.Date:
or input string: "Jun"), Type conversion of field [endDate] to type [java.sql.
te] failed for value "21-Jun-06": org.ofbiz.base.util.GeneralException: Could
t convert 21-Jun-06 to java.sql.Date:  (For input string: "Jun")]


I am using Ofbiz build 5924 and database is derby.
Could someone please guide me here?

TIA
Sangeeta

============================================================================================================================

Tech Mahindra, formerly Mahindra-British Telecom.


Disclaimer:


The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of Tech Mahindra and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of Tech Mahindra.


This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and Tech Mahindra is not responsible for any loss or damage arising in any way from its use.

============================================================================================================================
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Problem in storing date in database

subhradeep bhatacharya
Hi Sangeeta,
 
I think think the problem is that java.sql.Date doesn't support String in the format you have entered. Enter it in the format yyyy-MM-dd like 2006-06-20.
 
Hope it will work.
 
-Subhra


Sangeeta Bhatia <[hidden email]> wrote:

Hi everybody!
I am trying to build a small application in Of-biz.
I have a date field on a form which i wish to store in the database (derby).
However on using delegator.create(booking) , I am getting the following error:



30355 (http-0.0.0.0-8080-Processor4) [ ModelService.java:694:WARN ] [Mod
Service.makeValid] : Type conversion of field [startDate] to type [java.sql.Da
] failed for value "20-Jun-06": org.ofbiz.base.util.GeneralException: Could no
convert 20-Jun-06 to java.sql.Date: (For input string: "Jun")
30370 (http-0.0.0.0-8080-Processor4) [ ModelService.java:694:WARN ] [Mod
Service.makeValid] : Type conversion of field [endDate] to type [java.sql.Date
failed for value "21-Jun-06": org.ofbiz.base.util.GeneralException: Could not
nvert 21-Jun-06 to java.sql.Date: (For input string: "Jun")
30370 (http-0.0.0.0-8080-Processor4) [ RequestHandler.java:284:ERROR] Requ
t confirmBooking caused an error with the following message: [Type conversion
field [startDate] to type [java.sql.Date] failed for value "20-Jun-06": org.o
iz.base.util.GeneralException: Could not convert 20-Jun-06 to java.sql.Date:
or input string: "Jun"), Type conversion of field [endDate] to type [java.sql.
te] failed for value "21-Jun-06": org.ofbiz.base.util.GeneralException: Could
t convert 21-Jun-06 to java.sql.Date: (For input string: "Jun")]


I am using Ofbiz build 5924 and database is derby.
Could someone please guide me here?

TIA
Sangeeta

============================================================================================================================

Tech Mahindra, formerly Mahindra-British Telecom.


Disclaimer:


The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of Tech Mahindra and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of Tech Mahindra.


This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and Tech Mahindra is not responsible for any loss or damage arising in any way from its use.

============================================================================================================================

_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users


Ring'em or ping'em. Make PC-to-phone calls as low as 1ยข/min with Yahoo! Messenger with Voice.
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users