Subject Re: Failure on PreparedStatement
Author Roman Rokytskyy
Hi,

> Okay, I've isolated the problem even though I'm still not sure why
> it happens. You should be able to reproduce this no problem.
>
> Go to your TestFBBlobParam.java file. Right after the CREATE_TABLE
> statement execution, populate it with one row. Try this:
>
> PreparedStatement ps = connection.prepareStatement( "INSERT INTO
> ClassMap(oid,className,mapping,codebase) VALUES (?,?,?,?);" );
> try
> {
> ps.setInt(1,1);
> ps.setString(2,PreparedStatement.class.getName());
> ps.setString(3,"foo");
> ps.setString(4,"bar");
> ps.executeUpdate();
> }
> catch ( Exception e )
> {
> e.printStackTrace();
> throw e;
> }
>
> Now you should see the same failure I was getting when you run the
> #testParams method. I still don't know what is causing the failure,
> but this should allow you to at least reproduce it. (The problem was
> that you had a table with blob fields but it had no data)

Thank you for the test! I have added some more debug output and found
that original stack trace is:

org.firebirdsql.gds.GDSException: internal error
at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1697)
at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1650)
at org.firebirdsql.jgds.GDS_Impl.isc_dsql_fetch(GDS_Impl.java:1015)
at
org.firebirdsql.jca.FBManagedConnection.fetch(FBManagedConnection.java:802)
at org.firebirdsql.jdbc.FBConnection.fetch(FBConnection.java:1116)
at
org.firebirdsql.jdbc.FBStatementFetcher.fetch(FBStatementFetcher.java:113)
at
org.firebirdsql.jdbc.FBStatementFetcher.<init>(FBStatementFetcher.java:55)
at org.firebirdsql.jdbc.FBResultSet.<init>(FBResultSet.java:103)
at org.firebirdsql.jdbc.FBStatement.getResultSet(FBStatement.java:550)
at
org.firebirdsql.jdbc.FBPreparedStatement.executeQuery(FBPreparedStatement.java:111)
at
org.firebirdsql.jdbc.TestFBBlobParams.testParams(TestFBBlobParams.java:112)


This leads me to believe that the reason is comparison "=" operator on
blobs. I will ask this question in IB-Support list, since this is an
offtopic here.

Best regards,
Roman Rokytskyy