• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difficulty assigning Java Util Date to TemporalType field in Entity Bean

 
Jack Bush
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have getting the following syntax/compilation error (line 5, 6 below) when trying to enter the system date to Temporal Type:

setCollectionDate(java.util.Date) in domain.Customer cannot be applied to (java.lang.String).


I am running JDK 1.6.0_10, Glassfish v2r2, MySQL 5.0, Netbeans 6.1 on Windows XP platform.

I have also posted this question on http://forums.sun.com/thread.jspa?threadID=5338230 as well.

Any assistance would be much appreciated.

Thanks in advance,

Jack
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The format method returns a String, which you cannot put into a Date field.
I think you need to use a Date without formatting it.
 
Jack Bush
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Edvins,

Thanks for your advice which has resolved this issue.

Jack
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic