Package org.h2gis.functions.io.tsv
Class TSVDriverFunction
java.lang.Object
org.h2gis.functions.io.tsv.TSVDriverFunction
- All Implemented Interfaces:
org.h2gis.api.DriverFunction
This driver allow to import and export the Tab Separated Values (TSV): a
format for tabular data exchange
A file in TSV format consists of lines. Each line contain fields separated
from each other by TAB characters (horizontal tab, HT, Ascii control code 9).
"Field" means here just any string of characters, excluding TABs. The point
is simply that TABs divide a line into pieces, components.
Each line must contain the same number of fields.
The first line contains the names for the fields (on all lines), i.e. column
headers.
Please read : http://www.cs.tut.fi/~jkorpela/TSV.html
- Author:
- Erwan Bocher, Sylvain PALOMINOS (UBS 2019)
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.h2gis.api.DriverFunction
org.h2gis.api.DriverFunction.IMPORT_DRIVER_TYPE -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexportFromResultSet(Connection connection, ResultSet res, Writer writer, String encoding, org.h2gis.api.ProgressVisitor progress) Export a resultset to a TSV fileString[]exportTable(Connection connection, String tableReference, File fileName, boolean deleteFiles, org.h2gis.api.ProgressVisitor progress) String[]exportTable(Connection connection, String tableReference, File fileName, String encoding, boolean deleteFiles, org.h2gis.api.ProgressVisitor progress) String[]exportTable(Connection connection, String tableReference, File fileName, String encoding, org.h2gis.api.ProgressVisitor progress) Export a table or a query to as TSV fileString[]exportTable(Connection connection, String tableReference, File fileName, org.h2gis.api.ProgressVisitor progress) String[]getFormatDescription(String format) org.h2gis.api.DriverFunction.IMPORT_DRIVER_TYPEString[]String[]importFile(Connection connection, String tableReference, File fileName, boolean deleteTables, org.h2gis.api.ProgressVisitor progress) String[]importFile(Connection connection, String tableReference, File fileName, String options, boolean deleteTables, org.h2gis.api.ProgressVisitor progress) String[]importFile(Connection connection, String tableReference, File fileName, String options, org.h2gis.api.ProgressVisitor progress) String[]importFile(Connection connection, String tableReference, File fileName, org.h2gis.api.ProgressVisitor progress) booleanisSpatialFormat(String extension)
-
Field Details
-
DESCRIPTION
-
-
Constructor Details
-
TSVDriverFunction
public TSVDriverFunction()
-
-
Method Details
-
getImportDriverType
public org.h2gis.api.DriverFunction.IMPORT_DRIVER_TYPE getImportDriverType()- Specified by:
getImportDriverTypein interfaceorg.h2gis.api.DriverFunction
-
getImportFormats
- Specified by:
getImportFormatsin interfaceorg.h2gis.api.DriverFunction
-
getExportFormats
- Specified by:
getExportFormatsin interfaceorg.h2gis.api.DriverFunction
-
getFormatDescription
- Specified by:
getFormatDescriptionin interfaceorg.h2gis.api.DriverFunction
-
isSpatialFormat
- Specified by:
isSpatialFormatin interfaceorg.h2gis.api.DriverFunction
-
exportTable
public String[] exportTable(Connection connection, String tableReference, File fileName, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException - Specified by:
exportTablein interfaceorg.h2gis.api.DriverFunction- Throws:
SQLExceptionIOException
-
exportTable
public String[] exportTable(Connection connection, String tableReference, File fileName, boolean deleteFiles, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException - Specified by:
exportTablein interfaceorg.h2gis.api.DriverFunction- Throws:
SQLExceptionIOException
-
exportTable
public String[] exportTable(Connection connection, String tableReference, File fileName, String encoding, boolean deleteFiles, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException - Specified by:
exportTablein interfaceorg.h2gis.api.DriverFunction- Throws:
SQLExceptionIOException
-
exportTable
public String[] exportTable(Connection connection, String tableReference, File fileName, String encoding, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException Export a table or a query to as TSV file- Specified by:
exportTablein interfaceorg.h2gis.api.DriverFunction- Parameters:
connection- Active connection, do not close this connection.tableReference- [[catalog.]schema.]table referencefileName- File path to readprogress-encoding-- Throws:
SQLExceptionIOException
-
exportFromResultSet
public void exportFromResultSet(Connection connection, ResultSet res, Writer writer, String encoding, org.h2gis.api.ProgressVisitor progress) throws SQLException Export a resultset to a TSV file- Parameters:
connection-res-writer-progress-encoding-- Throws:
SQLException
-
importFile
public String[] importFile(Connection connection, String tableReference, File fileName, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException - Specified by:
importFilein interfaceorg.h2gis.api.DriverFunction- Throws:
SQLExceptionIOException
-
importFile
public String[] importFile(Connection connection, String tableReference, File fileName, String options, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException - Specified by:
importFilein interfaceorg.h2gis.api.DriverFunction- Throws:
SQLExceptionIOException
-
importFile
public String[] importFile(Connection connection, String tableReference, File fileName, boolean deleteTables, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException - Specified by:
importFilein interfaceorg.h2gis.api.DriverFunction- Throws:
SQLExceptionIOException
-
importFile
public String[] importFile(Connection connection, String tableReference, File fileName, String options, boolean deleteTables, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException - Specified by:
importFilein interfaceorg.h2gis.api.DriverFunction- Throws:
SQLExceptionIOException
-