Package org.h2gis.functions.io.json

## Class JsonWrite

- java.lang.Object
- - org.h2gis.api.AbstractFunction
  - - org.h2gis.functions.io.json.JsonWrite

All Implemented Interfaces:
  `org.h2gis.api.Function`, `org.h2gis.api.ScalarFunction`

    public class JsonWrite
    extends org.h2gis.api.AbstractFunction
    implements org.h2gis.api.ScalarFunction

SQL function to write a table to a JSON file.

Author:
  Erwan Bocher (CNRS), Sylvain PALOMINOS (Lab-STICC UBS, Chaire GEOTERA, 2020)

### Field Summary

### Fields inherited from interface org.h2gis.api.Function

`PROP_NAME, PROP_REMARKS`

### Fields inherited from interface org.h2gis.api.ScalarFunction

`PROP_DETERMINISTIC`

### Constructor Summary

Constructors
`JsonWrite()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static void` `exportTable​(Connection connection, String fileName, String tableReference)` Write the JSON file.
`static void` `exportTable​(Connection connection, String fileName, String tableReference, boolean deleteFile)`
`String` `getJavaStaticMethod()`

### Methods inherited from class org.h2gis.api.AbstractFunction

`addProperty, getProperty, removeProperty`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.h2gis.api.Function

`getProperty`

### Constructor Detail

#### JsonWrite

    public JsonWrite()

### Method Detail

#### getJavaStaticMethod

    public String getJavaStaticMethod()

Specified by:
  `getJavaStaticMethod` in interface `org.h2gis.api.ScalarFunction`

#### exportTable

    public static void exportTable​(Connection connection,
                                   String fileName,
                                   String tableReference,
                                   boolean deleteFile)
                            throws IOException,
                                   SQLException

Parameters:
  `connection` - Connection to the database.
  `fileName` - Name of the destination file.
  `tableReference` - Name of the table to export or select query. Note : The select query must be enclosed in parenthesis
  `deleteFile` - True if the destination files should be deleted, false otherwise.
Throws:
  `SQLException` - Exception thrown when an SQL error occurs.
  `IOException` - Exception when a file writing error occurs.

#### exportTable

    public static void exportTable​(Connection connection,
                                   String fileName,
                                   String tableReference)
                            throws SQLException,
                                   IOException

Write the JSON file.

Parameters:
  `connection` - Connection to the database.
  `fileName` - Name of the destination file.
  `tableReference` - Name of the table to export or select query. Note : The select query must be enclosed in parenthesis
Throws:
  `SQLException` - Exception thrown when an SQL error occurs.
  `IOException` - Exception when a file writing error occurs.