/** * queryJsonObject. * * @param sql sql * @param paramList paramList * @param connection connection * @param tableName tableName * @param isDebug the specified debug flag * @return JSONObject only one record. * @throws SQLException SQLException * @throws JSONException JSONException * @throws RepositoryException repositoryException */ public static JSONObject queryJsonObject(final String sql, final List<Object> paramList, final Connection connection, final String tableName, final boolean isDebug) throws SQLException, JSONException, RepositoryException { return queryJson(sql, paramList, connection, true, tableName, isDebug); }
/** * queryJsonArray. * * @param sql sql * @param paramList paramList * @param connection connection * @param tableName tableName * @param isDebug the specified debug flag * @return JSONArray * @throws SQLException SQLException * @throws JSONException JSONException * @throws RepositoryException repositoryException */ public static JSONArray queryJsonArray(final String sql, final List<Object> paramList, final Connection connection, final String tableName, final boolean isDebug) throws SQLException, JSONException, RepositoryException { final JSONObject jsonObject = queryJson(sql, paramList, connection, false, tableName, isDebug); return jsonObject.getJSONArray(Keys.RESULTS); }
/** * queryJsonObject. * * @param sql sql * @param paramList paramList * @param connection connection * @param tableName tableName * @param isDebug the specified debug flag * @return JSONObject only one record. * @throws SQLException SQLException * @throws JSONException JSONException * @throws RepositoryException repositoryException */ public static JSONObject queryJsonObject(final String sql, final List<Object> paramList, final Connection connection, final String tableName, final boolean isDebug) throws SQLException, JSONException, RepositoryException { return queryJson(sql, paramList, connection, true, tableName, isDebug); }
/** * queryJsonArray. * * @param sql sql * @param paramList paramList * @param connection connection * @param tableName tableName * @param isDebug the specified debug flag * @return JSONArray * @throws SQLException SQLException * @throws JSONException JSONException * @throws RepositoryException repositoryException */ public static JSONArray queryJsonArray(final String sql, final List<Object> paramList, final Connection connection, final String tableName, final boolean isDebug) throws SQLException, JSONException, RepositoryException { final JSONObject jsonObject = queryJson(sql, paramList, connection, false, tableName, isDebug); return jsonObject.getJSONArray(Keys.RESULTS); }