Code: Select all
byte[] byteArr = new byte[20];
IDBManager dbMan;
....... populate byte array ........
String query = "INSERT INTO EventTypes (binaryDataColumn) VALUES (?)";
dbMan.executeUpdate(query, new Object[] { byteArr } );
this works correctly for all other data types, but anytime i try to insert anything into a blob column in the database it gives me the following error:
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'EventTypescol' at row 1
even if i was to repolace the byte array param to lets say 1010 in the new Object[] { 1010 }, it still gives me that error