hi,
just a quick question from a java newbie.
what would be the easiest way to cast the output from the dbManager.executeQuery (an ArrayList) to a JSONObject so i can send it back to the client.
Do i have to cycle through each row in the ArrayList and add the items manually?
thanks.
ArrayList > JSONObject
ok i think i've found a way:
[/code]
Code: Select all
ArrayList<DataRow> queryRes = dbManager.executeQuery(sql);
if (queryRes != null && queryRes.size() > 0)
{
int queryResLength = queryRes.size();
for(int i=0; i < queryResLength; i++)
{
DataRow row = queryRes.get(i);
jso.add(row.getDataAsMap());
}
}
return jso;
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 21 guests