public abstract class SimpleJsonUtils extends Object
Utility methods for simple JSON support.
Constructor and Description |
---|
SimpleJsonUtils() |
Modifier and Type | Method and Description |
---|---|
static Clob |
arrayToClob(org.json.simple.JSONArray array)
SQL FUNCTION to convert a JSONArray into a CLOB.
|
static org.json.simple.JSONArray |
readArray(Reader reader)
Construct a JSONArray from a Reader.
|
static org.json.simple.JSONArray |
readArrayFromFile(String fileName,
String characterSetName)
SQL FUNCTION to read a JSONArray from a File.
|
static org.json.simple.JSONArray |
readArrayFromStream(InputStream inputStream,
String characterSetName)
Read a JSONArray from an InputStream.
|
static org.json.simple.JSONArray |
readArrayFromString(String document)
SQL FUNCTION to convert a JSON document string into a JSONArray.
|
static org.json.simple.JSONArray |
readArrayFromURL(String urlString,
String characterSetName)
SQL FUNCTION to read a JSONArray from an URL address.
|
static org.json.simple.JSONArray |
toJSON(ResultSet rs)
Pack a ResultSet into a JSONArray.
|
public static org.json.simple.JSONArray toJSON(ResultSet rs) throws SQLException
Pack a ResultSet into a JSONArray. This method could be called client-side on any query result from any DBMS. Each row is converted into a JSONObject whose keys are the corresponding column names from the ResultSet. Closes the ResultSet once it has been drained. Datatypes map to JSON values as follows:
SQLException
public static org.json.simple.JSONArray readArray(Reader reader) throws SQLException
SQLException
public static org.json.simple.JSONArray readArrayFromString(String document) throws SQLException
SQL FUNCTION to convert a JSON document string into a JSONArray. This function is registered by the simpleJson optional tool.
SQLException
public static org.json.simple.JSONArray readArrayFromStream(InputStream inputStream, String characterSetName) throws SQLException
SQLException
public static org.json.simple.JSONArray readArrayFromFile(String fileName, String characterSetName) throws SQLException
SQLException
public static org.json.simple.JSONArray readArrayFromURL(String urlString, String characterSetName) throws SQLException
SQLException
public static Clob arrayToClob(org.json.simple.JSONArray array)
Apache Derby 10.12 API Documentation - Copyright © 2004,2015 The Apache Software Foundation. All Rights Reserved.