Reading a JSON Array in JAVA
<p>I'm having a problem reading JSON Array because inside my array, there's another array and I'm confused.Please see my code.</p>

<pre><code>    JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
    JSONObject obj = JSONFactoryUtil.createJSONObject();
    JSONObject jsonObjectReturn =  JSONFactoryUtil.createJSONObject();

    //JSONOBJECT RETURN
    JSONArray array = JSONFactoryUtil.createJSONArray();



        for (int i = 0; i &lt; jsonArray.length(); i++) {
            obj = jsonArray.getJSONObject(i);

            callableStatement = (CallableStatement) conn
                    .prepareCall("{call TaxpaymentSPv2(?,?,?,?,?,?,?,?)}");


            callableStatement.setString(1, obj.getString("rdoCode"));
            callableStatement.setString(2, obj.getString("rcoCode"));
            callableStatement.setString(3, obj.getString("tpTin"));
            callableStatement.setString(4,  obj.getString("tpName")); 
            callableStatement.setString(5, obj.getString("tpAddress"));
            callableStatement.setString(6, obj.getString("receiptType"));
            callableStatement.registerOutParameter(7, Types.VARCHAR);
            callableStatement.registerOutParameter(8, Types.VARCHAR);

            callableStatement.executeUpdate();

            String rNo = callableStatement.getString(7);
            String date = callableStatement.getString(8);


            //----&gt;This is my second Array inside my JSON where im having an error &lt;------
            String checkArray = obj.getString("checkArray");
            JSONArray jsonArrayCheck = JSONFactoryUtil.createJSONArray(stringArray);


            JSONArray jsonArray2 = jsonObject.getJSONArray("checkArray");
            System.out.println("..........." + jsonArray2);

            jsonObjectReturn =  JSONFactoryUtil.createJSONObject();
            jsonObjectReturn.put("rNo", rNo);
            jsonObjectReturn.put("date", date);
            array.put(jsonObjectReturn);
        }

        return array;
</code></pre>

<p>Here's my JSON input:</p>

<pre><code>{
"dataArray": [{

"rdoCode": "001",
"rcoCode": "002911",
"tpTin": "200746409",
"tpName": "JOHN DOE",
"tpAddress": "LA CALIFORNIA",
"receiptType":"ROR",
"receiptMode":"AUTO",
"manualReceiptNo":"",
"checkArray":[{
"ptchkNumber": 14546,
"ptchkDate": 2014-01-01,
"ptchkAmount": 5332,
"ptchkStatus": ""
}]
}]
}
</code></pre>

<p>I can't parse the <strong>"checkArray"</strong> object that gives me this error. <code>com.liferay.portal.kernel.json.JSONException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1]</code>. Can someone tell me what to do? Thanks.</p>