Android Question JRDC2 error

marcick

Well-Known Member
Licensed User
Longtime User
I'm trying to move my code from JRDC to JRDC2 but now I get an error on the server when I use ExecuteQuery2 from the client.
The line in JRDC2 that generate the error is this

B4X:
Dim data() As Byte = ser.ConvertObjectToBytes(res)

And the error is:

B4X:
java.lang.RuntimeException: java.lang.RuntimeException: Cannot serialize object: 2015-12-0412:07:08.0

Any hint ?
 

b4auser1

Well-Known Member
Licensed User
Longtime User
Check this:
Due to the usage of B4XSerializator with other platforms, the two types should be declared in the main module:
B4X:
Sub Process_Globals
   Dim reqManager As DBRequestManager
   Type DBResult (Tag As Object, Columns As Map, Rows As List)
   Type DBCommand (Name As String, Parameters() As Object)
End Sub
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Thank you but, yes, it is.
The error appears also in the original JRDC2 source code
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
that error I suppose is related to a column Timestamp or DateTime (I have both types in the MySQL db)
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
B4X:
sql.RDC_Sync = SELECT * FROM `records` WHERE (( `Pwd` = ? OR `Pwd` = ?) AND `Index` > ? AND `Device` NOT LIKE ?)
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
something is changing but have other errors and need to understand better tomorrow.
I have a bigint(20) column also. Could it create problems in serializator ?
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Solved. The problem was that using "DATE_FORMAT(sdate,'%d %m %Y')" the column name that is returned to the client is not "sdate" but "DATE_FORMAT(col3,'%d %m %Y')" ....

So I have modified the query using "AS"

B4X:
DATE_FORMAT("sdate",'%d %m %Y') AS "sdate"

Everything seems to works fine now.
This foum is better than a school.
Thanks again !
 
Upvote 0
Top