iDBmanager for updating bytes into blob column of mysql

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

maniatis1
Posts: 5
Joined: 04 Oct 2011, 21:23

iDBmanager for updating bytes into blob column of mysql

Postby maniatis1 » 02 Mar 2012, 02:40

I am currently executing the following statement to try to insert values into a blob column of a mysql database using idbmanager's execute update function:

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

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 115 guests