Android Question jRDC2, MS-SQLSRV and text

Hagen Schloemer

Member
Licensed User
Longtime User
Hi!

I am using jrdc2 and mssql-server (2008rc2) to query data from mssql-server. everthig works fine but i need to display text with more than varchar(8000)-length, in the original database these fields are represented by datatype "text". If i create a query with a text-field inside the answer if the jrdc2 is:

java.lang.RuntimeException: Cannot serialize object: net.sourceforge.jtds.jdbc.ClobImpl@5a2feb02

if i create fields with less or equal 8000 bytes (varchar), everything is ok. What i can do?

I have also tested varchar(max) with the same result.

best regards
Hagen
 
Last edited:

MarcoRome

Expert
Licensed User
Longtime User
Hi!

I am using jrdc2 and mssql-server (2008rc2) to query data from mssql-server. everthig works fine but i need to display text with more than varchar(8000)-length, in the original database these fields are represented by datatype "text". If i create a query with a text-field inside the answer if the jrdc2 is:

java.lang.RuntimeException: Cannot serialize object: net.sourceforge.jtds.jdbc.ClobImpl@5a2feb02

if i create fields with less or equal 8000 bytes (varchar), everything is ok. What i can do?

I have also tested varchar(max) with the same result.

best regards
Hagen
Look HERE
 
Upvote 0

Hagen Schloemer

Member
Licensed User
Longtime User
Hi!

The solution for this case was to cast into a string (varchar(255)). This works, but the string is to small. The maximum for varchar is 8000 (this is also functional) or varchar(max), the serialization error raises on varchar(max) or native the datatype "text". In my sql-server there are fields with html-text (and embedded picures inside), i need to display and edit this fields in my tablet application. The varchar(8000) is often to small.

best regards
Hagen
 
Upvote 0

Hagen Schloemer

Member
Licensed User
Longtime User
What do you mean? The useLobs=False -Parameter has no visible Effect, the cast will cut my data...
Has anyone a functional sample with a "text"-datafield or a varchar(max) datafield?
 
Upvote 0

Hagen Schloemer

Member
Licensed User
Longtime User
Hi!

I have installed the b4j evironment on the sql-server, run the app and now its functional. I cant see the conversion-error again.....

Thanks for your help!
 
Upvote 0
Top