Calendar Component and validation errors

Hi,

For the first time I am trying to use the Calendar component to insert a date field in my SQL Server db.

The problem: I can insert a date column only if its of type java.sql.Timestamp.

As Timestamp extends the date object..

I tried to bind the selectedDate field as <Timestamp> Object[refractored in my class file] and when i tried to update by DB it throwing a Validation error.

If I bind it as a Date Object directly I am getting an EvaluvationException

as date objects cannot be inserted directly

Am i missing something here or is there a proper way of implementing it.

[629 byte] By [TheCarribeanKida] at [2007-11-27 10:16:47]
# 1

Its a fairly direct question about object conversion problem in creator

Basically the selectedDate parameter of the JSC Calendar component

needs to be pointed to a Date Object

If we need to insert that date information to a SQL Server column the equivalent data type should be java.sql.Timestamp which extends Date.

So if we point the selectedDate parameter as a Timestamp object the creator throws an illegal argument exception.

Can some one clarify how to resolve this issue?

TheCarribeanKida at 2007-7-28 15:47:39 > top of Java-index,Development Tools,Java Tools...