JSON Object From Java -


can me how create json object database.

this json output should like.

       [{ text_layerg: 'kanpur analyst roads',  cls: 'folder', children: [{     text    :   'road major',     layers  :   'analyst_kanpur:road_major',     leaf    :   true,     checked : false },{     text    : 'road_minior',     leaf    : true,     layers  :   'analyst_kanpur:road_minor',     checked : false },{     text    : 'road_colony',     leaf    : true,     layers  :   'analyst_kanpur:road_colony',     checked: false }] 

i need populate text , layers field database

this select query

string str="select id, tablename, layername,layer_display_name,layer,visibility,isbaselayer, group_name " +                 " layermeta " +                 " join  layer_groups on layer_group_id=group_id " +                 " id not in (72, 73,79) " +                 " order sequence"; 

where text_layerg group_name ,

string text=rsm.getstring("layer_display_name");             string layers=rsm.getstring("layer");             boolean leaf=true;             boolean checked=false;             string groupname=rsm.getstring("group_name");             jsonobject jobj = new jsonobject();             jobj.put("text", text);             jobj.put("layers", layers);             jobj.put("leaf", leaf);             jobj.put("checked",checked);             jarray.put("children",jobj);             jsonobject jobjdevice = new jsonobject();             jobjdevice.put("children", jarray); 

this wrote , got stuck in middle

please me

maybe jsonarray object need. check more examples.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -