Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[solved] Blob subtype 0 creates "org.firebirdsql.jdbc.FBCachedBlob cannot be cast to org.firebirdsql.jdbc.FBBlob" on select [JDBC168] #212

Closed
firebird-automations opened this issue Feb 10, 2011 · 6 comments

Comments

@firebird-automations
Copy link

Submitted by: Dr. Schorsch (xorx)

Assigned to: Roman Rokytskyy (rrokytskyy)

I have a database table with a column of type Blob, subtype 0, containing an image.
When I do a select on this table it works fine. Open office shows "<OBJECT>" in the table view for the image column and it displays the image in the form.

Now I created the following query:

SELECT "Auflagen".*, "Techniken"."TechnikD", "Techniken"."TechnikE", "Werkgruppen"."WerkgruppeD", "Werkgruppen"."WerkgruppeE", "Werke"."TitelD", "Auflagen"."BildHoehe", "Werke"."TitelE", "Werke"."Jahr", "Werke"."Beschreibung", "Werke"."Bild" FROM "Auflagen" AS "Auflagen", "Werke" AS "Werke", "Techniken" AS "Techniken", "Werkgruppen" AS "Werkgruppen" WHERE "Auflagen"."WerkID" = "Werke"."ID" AND "Techniken"."ID" = "Werke"."TechnikID" AND "Werkgruppen"."ID" = "Werke"."WerkGruppeID" ORDER BY "Werkgruppen"."WerkgruppeD" ASC, "Werke"."TitelD" DESC, "Auflagen"."BildHoehe" DESC

This request works fine from FlameRobin.

Performing this query from openoffice via firebird JDBC does produce the following error:

org.firebirdsql.jdbc.FBCachedBlob cannot be cast to org.firebirdsql.jdbc.FBBlob

When I remove the column "Werke"."Bild", which is the blob containing the image, the request works fine again.

Any ideas around?
Thanks,

Georg

@firebird-automations
Copy link
Author

Modified by: Dr. Schorsch (xorx)

Version: Jaybird 2.2 [ 10053 ]

Version: Jaybird 2.1.6 [ 10285 ] =>

@firebird-automations
Copy link
Author

Commented by: Dr. Schorsch (xorx)

We have tested the same database using a Java program to connect to it. There was some issue with the code generation for a table containing the binary blob, but an image control does display the image and there is no type cast error message. Therefore I think we have to look in OOo base for the reason of this failure.

@firebird-automations
Copy link
Author

Modified by: Dr. Schorsch (xorx)

priority: Major [ 3 ] => Trivial [ 5 ]

timeestimate: 0 [ 0 ]

timeoriginalestimate: 0 [ 0 ]

summary: Blob subtype 0 creates "org.firebirdsql.jdbc.FBCachedBlob cannot be cast to org.firebirdsql.jdbc.FBBlob" on select => [solved] Blob subtype 0 creates "org.firebirdsql.jdbc.FBCachedBlob cannot be cast to org.firebirdsql.jdbc.FBBlob" on select

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

Fix Version: Jaybird 2.2 [ 10053 ]

@firebird-automations
Copy link
Author

Commented by: Roman Rokytskyy (rrokytskyy)

The issue is related to the fact how OO works with JDBC. It violates the specification in some places, therefore we have a special driver for OO users that tolerates those violations in expense of memory (basically, it makes all statements cached, which means that each result set will be fully fetched to the client).

So, with version from HEAD you can use another URL - jdbc:firebirdsql:oo: , driver will do the rest.

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

status: Open [ 1 ] => Closed [ 6 ]

resolution: Fixed [ 1 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant