Parsing to a date object

Hi all,

I want to parse a string to a certain date format, so I can save it in an oracle 10 database. I have tried several things like:

public void setDatum(String datum) {

SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");

this.datum = df.parse(datum)

}

When I do this the compiler says that df can't parse form Date to Date but, as you can see, I send a String with the parse() method.

BTW -->this.datum is a Date object.

Does anyone had this problem before or have a alternative solution for this.

thnx in advance

[588 byte] By [mol-mola] at [2007-10-3 2:07:26]
# 1
> or have a alternative solution for this.Give that String a different name. It's bad coding style anyway.
CeciNEstPasUnProgrammeura at 2007-7-14 19:06:18 > top of Java-index,Java Essentials,Java Programming...
# 2
yeah yeah i know, just testing stuff that's why.
mol-mola at 2007-7-14 19:06:18 > top of Java-index,Java Essentials,Java Programming...
# 3
What surprises me is that you get an error at all - because local variables get precedence. So it should work. What exactly does the compiler say?
CeciNEstPasUnProgrammeura at 2007-7-14 19:06:18 > top of Java-index,Java Essentials,Java Programming...