public abstract class SimpleJsonUtils
extends java.lang.Object
Utility methods for simple JSON support.
| Constructor and Description |
|---|
SimpleJsonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.sql.Clob |
arrayToClob(JSONArray array)
SQL FUNCTION to convert a JSONArray into a CLOB.
|
static JSONArray |
readArray(java.io.Reader reader)
Construct a JSONArray from a Reader.
|
static JSONArray |
readArrayFromFile(java.lang.String fileName,
java.lang.String characterSetName)
SQL FUNCTION to read a JSONArray from a File.
|
static JSONArray |
readArrayFromStream(java.io.InputStream inputStream,
java.lang.String characterSetName)
Read a JSONArray from an InputStream.
|
static JSONArray |
readArrayFromString(java.lang.String document)
SQL FUNCTION to convert a JSON document string into a JSONArray.
|
static JSONArray |
readArrayFromURL(java.lang.String urlString,
java.lang.String characterSetName)
SQL FUNCTION to read a JSONArray from an URL address.
|
static JSONArray |
toJSON(java.sql.ResultSet rs)
Pack a ResultSet into a JSONArray.
|
public static JSONArray toJSON(java.sql.ResultSet rs)
throws java.sql.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:
java.sql.SQLExceptionpublic static JSONArray readArray(java.io.Reader reader)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static JSONArray readArrayFromString(java.lang.String document)
throws java.sql.SQLException
SQL FUNCTION to convert a JSON document string into a JSONArray. This function is registered by the simpleJson optional tool.
java.sql.SQLExceptionpublic static JSONArray readArrayFromStream(java.io.InputStream inputStream,
java.lang.String characterSetName)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static JSONArray readArrayFromFile(java.lang.String fileName,
java.lang.String characterSetName)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static JSONArray readArrayFromURL(java.lang.String urlString,
java.lang.String characterSetName)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static java.sql.Clob arrayToClob(JSONArray array)
Apache Derby 10.13 API Documentation - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.