B4J Question JRDC2 return Json

B4X: Copy
Type DBResult (Tag As Object, Columns As Map, Rows As List)

You get a DBResult, You can create a map with the column name and the values, and then create a json with jsonGenerator
 
Upvote 0
B4X: Copy
Sub ReturnJSON(map As Map, resp As ServletResponse)
    resp.ContentType = "application/json"
    resp.Write(Map2Json(map))
End Sub
 
Upvote 0
Here is another sample:
 
Upvote 0
Back
Top