Subject | Re: PreparedStatements - bug in handling exception |
---|---|
Author | Nick Sydenham |
Post date | 2004-04-08T17:15:34Z |
The error below occurs when a parameter is too big when used with
JayBird1.5b3. If I try it with FirebirdSQL1.0.1 I get a data
truncation error which at least is a lot easier to understand what the
problem is.
There should be an understandable error message.
--- In Firebird-Java@yahoogroups.com, "Nick Sydenham" <nsydenham@y...>
wrote:
JayBird1.5b3. If I try it with FirebirdSQL1.0.1 I get a data
truncation error which at least is a lot easier to understand what the
problem is.
There should be an understandable error message.
--- In Firebird-Java@yahoogroups.com, "Nick Sydenham" <nsydenham@y...>
wrote:
> OK, my fault, in the setXXX methods my index was as the fieldsorg.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:445)
> appeared in the table and not how they're defined in the SQL statement.
>
> Can anyone explain what the following cryptic error means:
>
> org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544794.
> operation was cancelled
> at
>
> atorg.firebirdsql.jdbc.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:147)
>
>f4, f3)
> Ta,
>
> Nick
>
> --- In Firebird-Java@yahoogroups.com, "Nick Sydenham" <nsydenham@y...>
> wrote:
> > --- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
> > <rrokytskyy@a...> wrote:
> > > > ps.setDate(4, parseDate(val));
> > > >
> > > > where parseDate returns a java.sql.Date with the hours, minutes,
> > > > seconds and milliseconds set to 0.
> > > >
> > > > I am assuming that with a PS of 'insert into table (f1, f2,
> > > > values (?, ?, ?, ?)' that the types are read in the ordertable.
> specified by
> > > > the SQL and not the order in which they are specified on the
> > >
> > > Correct, it uses order from the statement.
> > >
> > > > So fields 1, 2 and 4 are varchars, field 3 is a date on the table
> > > > defintion. So PS.setDate(4, date) is still correct in theory.
> > >
> > > Yes. Can you please provide a test case - Java class that creates
> > > appropriate table, populates it, and reproduces an error?
> > >
> > > Thanks!
> > > Roman
> >
> > A test case works fine. It might have something to do with the fact
> > that I've got 102 input parameters (noddy DB so design is limited
> > :-)). I'll investigate further.