martes, 3 de junio de 2014

There was no TypeHandler found for parameter BLOB

This error happens when u try to convert one inputStream into a BLOB,

For solve this you have to use an array of byte : Byte [], instead the inputStream type, in Ibatis.


In java code:
You can use Apache commons-io to handle this and similar tasks.
The IOUtils type has a static method to read an InputStream and return a byte[].
InputStream is;
byte[] bytes = IOUtils.toByteArray(is);
Internally this creates a ByteArrayOutputStream and copies the bytes to the output, then calls to ByteArray(). It handles large files by copying the bytes in blocks of 4MB.
ref: http://stackoverflow.com/questions/1264709/convert-inputstream-to-byte-in-java

No hay comentarios: