I’m trying to store MediumBlob data in MySQL using java. But I have no success to retrieve the data.
To store I’m using:
PreparedStatement = stmt conn.prepareStatement("UPDATE INTO table VALUE(?)");
ByteArrayInputStream bais = new ByteArrayInputStream(data);
stmt.setBinaryStream(position, bais, data.length);
Is there correcty?
I fix it!!!!
The problem was when I was retrieving the data. I was calling:
But I should call:
I have used setBinaryStream to input data!
This was confusing because I have a Clob field, and I was expecting retrieving a Clob field in Java code!