Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Why I cannot cast oracle BLOB from native java Blob

By: a guest on Feb 27th, 2012  |  syntax: None  |  size: 0.25 KB  |  views: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ...
  2. ResultSet rs = ...
  3. java.sql.Blob myfile = rs.getBlob("field")
  4. java.io.OutputStream os = ((oracle.sql.BLOB) myfile).getBinaryOutputStream();
  5.        
  6. java.lang.ClassCastException
  7.        
  8. java.io.OutputStream os = ((oracle.sql.BLOB) myBlob).setBinaryStream(1L);