M Mostez Well-Known Member Licensed User Longtime User Sep 8, 2021 #1 I use jRDC2.2 with MS SQL server 2012, I have column with type nvarchar(max) when I try to get data, I receive (RuntimeException) java.lang.RuntimeException: Cannot serialize object: I debugged ExecuteQuery2 in jRDC, this line B4X: Dim ct As Int = rsmd.RunMethod("getColumnType", Array(i + 1)) returns 2005 if column type is nvarchar(max) or 12 if column type is sized to n number of chars say 2000, nvarchar(2000) I set col size to 4000 to solve this problem for now, but I still need to fix it in jRDC cause I will face this problem with the rest of other tables!
I use jRDC2.2 with MS SQL server 2012, I have column with type nvarchar(max) when I try to get data, I receive (RuntimeException) java.lang.RuntimeException: Cannot serialize object: I debugged ExecuteQuery2 in jRDC, this line B4X: Dim ct As Int = rsmd.RunMethod("getColumnType", Array(i + 1)) returns 2005 if column type is nvarchar(max) or 12 if column type is sized to n number of chars say 2000, nvarchar(2000) I set col size to 4000 to solve this problem for now, but I still need to fix it in jRDC cause I will face this problem with the rest of other tables!
M Mostez Well-Known Member Licensed User Longtime User Sep 8, 2021 #2 I added this line, it works ok, but don't know if is it 100% correct B4X: Else if ct = 2005 Or ct = 12 Then 'SQL nvarchar(max), sized nvarchar and varchar data types row(i) = jrs.RunMethod("getString", Array(i + 1)) Upvote 1
I added this line, it works ok, but don't know if is it 100% correct B4X: Else if ct = 2005 Or ct = 12 Then 'SQL nvarchar(max), sized nvarchar and varchar data types row(i) = jrs.RunMethod("getString", Array(i + 1))
aeric Expert Licensed User Longtime User Sep 8, 2021 #3 B4X: Else If ct = 2005 Then ' Clob row(i) = rs.GetString2(i) https://www.b4x.com/android/forum/threads/jrdc2-connect-to-mssqllocaldb.126513/post-801190 Another method is to set useLOBs=false in JdbcURL B4X: JdbcUrl=jdbc:jtds:sqlserver://192.168.0.1:1433/DBName;useLOBs=false Upvote 1
B4X: Else If ct = 2005 Then ' Clob row(i) = rs.GetString2(i) https://www.b4x.com/android/forum/threads/jrdc2-connect-to-mssqllocaldb.126513/post-801190 Another method is to set useLOBs=false in JdbcURL B4X: JdbcUrl=jdbc:jtds:sqlserver://192.168.0.1:1433/DBName;useLOBs=false
OliverA Expert Licensed User Longtime User Sep 8, 2021 #4 @aeric , @Mostez Make a wish to have jRDC2 code updated to handle Clobs. This issue has been encountered more than once and it probably would be good if the base jRDC2 code would handle this case Upvote 0
@aeric , @Mostez Make a wish to have jRDC2 code updated to handle Clobs. This issue has been encountered more than once and it probably would be good if the base jRDC2 code would handle this case
Erel B4X founder Staff member Licensed User Longtime User Sep 9, 2021 #5 OliverA said: Make a wish to have jRDC2 code updated to handle Clobs. This issue has been encountered more than once and it probably would be good if the base jRDC2 code would handle this case Click to expand... Implemented in v2.23 Upvote 0
OliverA said: Make a wish to have jRDC2 code updated to handle Clobs. This issue has been encountered more than once and it probably would be good if the base jRDC2 code would handle this case Click to expand... Implemented in v2.23