Hallo, ich habe ein Problem mit Java und Blobs (Datenbank ist Oracle 8)
vorweg den Blob befüllen funktioniert wunderbar.
Wenn ich den Blob aber auslesen möchte bekomme ich immer folgende Exception: java.lang.NullPointerException
at LOBStreams.ExportBlob(LOBStreams.java:88)
at LOBStreams.main(LOBStreams.java:44)
Exception in thread „main“
Mir ist aufgefallen dass die Exception nur auftritt wenn das File welches ich hineinschreibe größer als 4kB ist.
Die Exception wird bei folgender Codezeile geworfen:
InputStream inStream = myBlob.getBinaryStream();
Vielen Dank für eure Hilfe
Grüße
Peter
Mir ist aufgefallen dass die Exception nur auftritt wenn das
File welches ich hineinschreibe größer als 4kB ist.
Ich vermute, du musst die „chunk size“ des BLOBs erhoehen.
Suche mal danach in der Oracle-Doku.
_oracle.sql.BLOB
getChunkSize(): Returns the Oracle chunking size, which can be
specified by the database administrator when the LOB column is first
created. This value, in Oracle blocks, determines the size of the
chunks of data read or written by the LOB data layer in accessing or
modifying the BLOB value. Part of each chunk stores system-related
information, and the rest stores LOB data. Performance is enhanced
if read and write requests use some multiple of the chunk size._
Gruss, Patrick