Subject Re: PreparedStatement with Date as Object
Author Roman Rokytskyy
> Here is another problem I have found with PreparedStatements. I
> have found the error in both Jaybird 1.0.? and Jaybird 1.5 RC3. I
> have an interface that provides access to different types of
> databases. My implementation of this interface takes a String query
> and an Object[] for parameters. I call setObject on each parameter
> in the Object[]. I get the following error when I pass a
> java.util.Date object. I have included a working code example and
> stack trace. Please let me know what you think and if you need any
> additional information. Thanks.

Driver simply does not know what to do with java.util.Date. JDBC
specification defines what to do with the java.sql.Date, java.sql.Time
and java.sql.Timestamp, but it does not tell what to do with
java.util.Date. Also JDBC specs do not require driver to do
serialization/deserialization.

So you either convert that stuff to java.sql.Date/Time/Timestamp, or
you find some other way to set your parameter.

Roman