Blob in Java/Hibernate/sql-server 2005

Posted by Ramy on Stack Overflow See other posts from Stack Overflow or by Ramy
Published on 2009-12-07T15:51:55Z Indexed on 2010/04/30 19:57 UTC
Read the original article Hit count: 414

Filed under:
|
|
|
|

Hi, I'm trying to insert an HTML blob into our sql-server2005 database. i've been using the data-type [text] for the field the blob will eventually live in. i've also put a '@Lob' annotation on the field in the domain model. The problem comes in when the HTML blob I'm attempting to store is larger than 65536 characters. Its seems that is the caracter-limit for a text data type when using the @Lob annotation. Ideally I'd like to keep the whole blob in tact rather than chunk it up into multiple rows in the database. I appreciate any help or insight that might be provided. Thanks! _Ramy

Allow me to clarify annotation:
@Lob
@Column(length = Integer. MAX_VALUE) //per an answer on stackoverflow
private String htmlBlob;

database side (sql-server-2005):
CREATE TABLE dbo.IndustrySectorTearSheetBlob(
...
htmlBlob text NULL
... )

Still seeing truncation after 65536 characters...

EDIT: i've printed out the contents of all possible strings (only 10 right now) that would be inserted into the Database. Each string seems to contain all cahracters, judging by the fact that the close html tag is present at the end of the string....

© Stack Overflow or respective owner

Related posts about blob

Related posts about java