I'm trying to save data arrived from RPCManager.sendRequest directly to the database (in VARCHAR type of column).
The arrived data are being saved as a string : rpcManager.getData().toString();
This works fine. However, when returning the same string from the database back to the client, the value is treated as a string and gets surrounded in double quotes.
Is it possible to re-create java Map object from such JSON string?
I tried :
1) list = SQLTransform.toListOfMaps(rslt); This returns a list of maps for each column but those maps are still being treated as strings
This last call is equivalent to rpc.getData().toString() and returns something like this to the client: //isc_RPCResponseStart-->[{status:0,data:"{myValues=[{ .... instead of //isc_RPCResponseStart-->[{status:0,data:{myValues=[{ .... (without surrounding data in "").
2) JSTranslater
3) sending string directly (rpcManager.send(json_str);
Nothing works.
Essentially, what would be the right way to convert from rpcManager.getData().toString() back to Java Map object?
SmartClient 8.2 eval and 8.2 pro.
thanks,
- g
The arrived data are being saved as a string : rpcManager.getData().toString();
This works fine. However, when returning the same string from the database back to the client, the value is treated as a string and gets surrounded in double quotes.
Is it possible to re-create java Map object from such JSON string?
I tried :
1) list = SQLTransform.toListOfMaps(rslt); This returns a list of maps for each column but those maps are still being treated as strings
Code:
rslt = stmt.executeQuery(); List list = SQLTransform.toListOfMaps(rslt); Iterator<?> it =list.iterator(); Map<?,?> map = (Map<?, ?>) it.next(); RPCManager rpc = new RPCManager(request, response); rpc.send(map);
2) JSTranslater
3) sending string directly (rpcManager.send(json_str);
Nothing works.
Essentially, what would be the right way to convert from rpcManager.getData().toString() back to Java Map object?
SmartClient 8.2 eval and 8.2 pro.
thanks,
- g
Comment