Package org.h2gis.functions.io.json
Class JsonWriteDriver
java.lang.Object
org.h2gis.functions.io.json.JsonWriteDriver
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
ConstructorsConstructorDescriptionJsonWriteDriver(Connection connection) A simple GeoJSON driver to write a spatial table to a GeoJSON file. -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(org.h2gis.api.ProgressVisitor progress, String tableName, File fileName, boolean deleteFile, String encoding) Write the table to JSON format.voidWrite 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 Details
-
JsonWriteDriver
A simple GeoJSON driver to write a spatial table to a GeoJSON file.- Parameters:
connection-
-
-
Method Details
-
write
public void write(org.h2gis.api.ProgressVisitor progress, ResultSet rs, File file, boolean deleteFile) throws SQLException, IOException Write 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, IOException Write 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, IOException Write 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.
-