java - Exception on excuteUpdate -


i getting exception

com.microsoft.sqlserver.jdbc.sqlserverexception: string or binary data truncated.   

the exception thrown @ following line:

preparestmt.setbinarystream(1, new bytearrayinputstream(data), data.length);   updatepreparestmt.executeupdate();   

i using ms-sql db. can me solve problem?

the datatype of column in trying insert data varbinary , length of data not large. inserting "test".

update
have increased size of datatype varbinary. made 1024, new exception :-

com.microsoft.sqlserver.jdbc.sqlserverexception:the conversion varbinary blob unsupported

can comment on exception?

as exception message sais, data seems larger database field should written to. maximum of data.length , what's maximum length of column?


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -