db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rogerio Leis" <roge...@kaizen.com.br>
Subject Fw: OJB+BLOB Oracle
Date Mon, 27 Oct 2003 13:52:37 GMT


Hi all,

Could you tell me how oracle Blobs are STORED, using OJB, please?

I can create a FieldConversion, but it has been used only to load.
see:

public class MyConversion implements FieldConversion
{
 public Object javaToSql(Object source) throws ConversionException 
 {
    // MODIFY THIS METHOD
    return source;
 }

 public Object sqlToJava(Object source) throws ConversionException 
 {
  if (source == null) 
  {
   return null;
  }
  try 
  {
   if (source instanceof Blob) 
   {
    Blob b = (Blob) source;
    byte[] bytes = b.getBytes(1, (int)b.length());
    return bytes;
   } 
   else 
   {
    return source;
   }
  } 
  catch(SQLException se) 
  {                      
   throw new WrappedRuntimeException(se);
  } 
 }
}


Somebody have a simple implementation of the javaToSql method for this case?
I accept others suggestion..

regards,
Rogerio
(Sorry my english)
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message