Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
CREATE TABLE MEDIA
(
   MEDIAID NUMBER(22) NOT NULL,
   BINARYDATA BLOB NOT NULL
);

CREATE   SEQUENCE   SEQ_MEDIAID
INCREMENT   BY   1
START   WITH   100
ORDER;



 Copying A Blob to A File!

Code Block

   ...
   byte_stream_test = blobTest.getBinaryStream()
   if( byte_stream_test == null ) {  println "Test: Received null stream!"  }
   
   blob_size = blobTest.length()
   println "Blob size: $blob_size"
   
   byte[] byte_array_test = new byte[blob_size]
   int bytes_read_test = byte_stream_test.read(byte_array_test)
   println "Read $bytes_read_test from the blob!"
   
   // Write to a file
   def fos= new FileOutputStream('c:\\Jornada\\auxil\\output.jpg')
   fos.write(byte_array_test);
   fos.close()
   ...