Subject Re: PreparedStatements
Author Nick Sydenham
I'm getting the following error when trying to set an SQL Date in a

org.firebirdsql.jdbc.field.TypeConvertionException: Error converting
to date.
at org.firebirdsql.jdbc.field.FBField.setDate(

which implies that something is not overriding the setDate method

--- In, "Roman Rokytskyy"
<rrokytskyy@a...> wrote:
> > It seems that PreparedStatements are not supported in JayBird as the
> > source for shows the following for all set methods:
> >
> > public void setDate(Date value, Calendar cal) throws SQLException
> > {
> > throw (SQLException)createException(
> > DATE_CONVERSION_ERROR).fillInStackTrace();
> > }
> >
> >
> > The release notes say that PreparedStatements are working. What's
> > the truth?
> Your understanding of sources is wrong. If you check FBField
> modifiers, you will see that class is abstract. You simply cannot
> instantiate it. When you check AbstractPreparedStatement and
> FBField.createField() method, you will see that it uses FBField
> subclasses, which implement only methods that are relevant for the
> particular data type. For possible conversion, see JDBC specification
> (somewhere in appendix, probably appendix B).
> So, PreparedStatement is fully supported as well as
> CallableStatement. Version from CVS passes most of JDBC CTS suite
> (only tests that are not relevant for Firebird were excluded).
> Roman