Timestamp startDate;
public void setStartDate(String date) {
this.startDate = Timestamp.valueOf(date);
}
public Timestamp getStartDate() {
return this.startDate;
}
and change the type of my Entity beans methods for date set and get of course. Works perfectly. Thanks again people.
Best Regards,
Olivier Voutat
On 4/6/06, David Carew <[EMAIL PROTECTED]> wrote:
The java.sql.Timestamp class has a static method called valueOf to convert Strings in the formatyyyy-mm-dd hh:mm:ss.fffffffff(where ffffffffff represents nanoseconds) to a java.sql.Timestamp instance. As pointed out previously, this is easier than writing your own converter. See Javadocs for java.sql.Timestamp for more info.
In your Entity Bean class you would declare the field like the following:
public abstract java.sql.Timestamp getstartDate();
public abstract void setStartDate(java.sql.Timestamp newStartDate);
And then you can use Timestamp.valueOf(String yourStartDateAsString) to convert as appropriate.
--
Olivier Jeanpierre Voutat
Rua Praia de Muriú, 9188
Cep 59092-390 / Natal - RN
Tel: (84) 3219-0427 Cel: (84) 9977-3917
