cancel
Showing results for 
Search instead for 
Did you mean: 

I forget where to change "java.util.date" to "java.sql.date"

Former Member
0 Kudos

In the thread below entitled "Question on initialize method (p. 25 of WDJ Tutorial #3 ) ", Christian Benoit agreed that there is an error on p.12 of Tutorial #3.

So to correct this error, I went back and defined Birthday as a simple type using the built-in type date instead of the simple type string (because Christian suggested that this change will get rid of the error message which results from coding the line given on page 25 in the initialize method:

wdContext.currentContextElement().setBirthday(new Date(0));

The problem is, when I do this, I get a different error message as follows:

"The method setBirthday(java.sql.date) in the type

IPrivateForm.IContextElement is not applicable for

the arguments (java.util.Date)"

I remember seeing this choice come up, but I don't remember where. So where do I indicate that I want java.sql.date and not java.util.date ???????

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Go to the "imports" section, remove the line "import java.util.Date", press CTRL-SHIFT-O and select java.sql.Date.

Armin

former_member181923
Active Participant
0 Kudos

Armin - thanks for confirming what I just remembered. Since you posted before I posted, I've awarded the 10 (if it makes any difference to you.)

Thanks again

Dave

Answers (1)

Answers (1)

former_member181923
Active Participant
0 Kudos

I remember now - it was when I organized my imports that I got the "sql" vs "util" prompt on "date". So I will delete the IPrivateForm import statement, do the organize again, and see if this lets me rechoose date.

Former Member
0 Kudos

No, delete the "import java.util.Date" line.

Armin

former_member181923
Active Participant
0 Kudos

Armin -

Boy do I feel stupid! Thanks for pointing that out to me.

It's a good thing I'm beyond embarassment, otherwise I'd be really embarassed.

Thanks again

Dave