Package org.h2gis.functions.io.json
Class JsonWriteDriver
- java.lang.Object
-
- org.h2gis.functions.io.json.JsonWriteDriver
-
public class JsonWriteDriver extends Object
JSON class to write a table or a resultset to a file- Author:
- Erwan Bocher (CNRS), Sylvain PALOMINOS (Lab-STICC UBS, Chaire GEOTERA, 2020)
-
-
Constructor Summary
Constructors Constructor Description JsonWriteDriver(Connection connection)A simple GeoJSON driver to write a spatial table to a GeoJSON file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidwrite(org.h2gis.api.ProgressVisitor progress, String tableName, File fileName, boolean deleteFile, String encoding)Write the table to JSON format.voidwrite(org.h2gis.api.ProgressVisitor progress, ResultSet rs, File file, boolean deleteFile)Write a resulset to a json filevoidwrite(org.h2gis.api.ProgressVisitor progress, ResultSet rs, File file, boolean deleteFile, String encoding)Write a resulset to a json file
-
-
-
Constructor Detail
-
JsonWriteDriver
public JsonWriteDriver(Connection connection)
A simple GeoJSON driver to write a spatial table to a GeoJSON file.- Parameters:
connection-
-
-
Method Detail
-
write
public void write(org.h2gis.api.ProgressVisitor progress, ResultSet rs, File file, boolean deleteFile) throws SQLException, IOExceptionWrite a resulset to a json file- Parameters:
progress- ProgressVisitor following the writing.rs- ResultSet containing the data to write.file- Destination file.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.
-
write
public void write(org.h2gis.api.ProgressVisitor progress, ResultSet rs, File file, boolean deleteFile, String encoding) throws SQLException, IOExceptionWrite a resulset to a json file- Parameters:
progress- ProgressVisitor following the writing.rs- ResultSet containing the data to write.file- Destination file.deleteFile- True if the destination files should be deleted, false otherwise.encoding- Encoding of the destination file.- Throws:
SQLException- Exception thrown when an SQL error occurs.IOException- Exception when a file writing error occurs.
-
write
public void write(org.h2gis.api.ProgressVisitor progress, String tableName, File fileName, boolean deleteFile, String encoding) throws SQLException, IOExceptionWrite the table to JSON format.- Parameters:
progress- ProgressVisitor following the writing.tableName- Name of the table to write or SQL query used to gather data to write.fileName- Destination file.deleteFile- True if the destination files should be deleted, false otherwise.encoding- Encoding of the destination file.- Throws:
SQLException- Exception thrown when an SQL error occurs.IOException- Exception when a file writing error occurs.
-
-