org.h2gis.h2spatialapi
Interface DriverFunction


public interface DriverFunction

This function can import/export a file into/from a table. Connection may be on a remote H2/Postgre database

Author:
Nicolas Fortin

Nested Class Summary
static class DriverFunction.IMPORT_DRIVER_TYPE
          A linked table is created instantly but work only if the DataBase is local.
 
Method Summary
 void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress)
           
 String[] getExportFormats()
          Get the file extensions that can be saved by this driver
 String getFormatDescription(String format)
           
 DriverFunction.IMPORT_DRIVER_TYPE getImportDriverType()
           
 String[] getImportFormats()
          Get the file extensions that can be loaded by this driver
 void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress)
           
 

Method Detail

getImportDriverType

DriverFunction.IMPORT_DRIVER_TYPE getImportDriverType()
Returns:
The driver type. A LINK Driver mean the usage of a TableEngine on H2 DataBase.

getImportFormats

String[] getImportFormats()
Get the file extensions that can be loaded by this driver

Returns:
file extension ex: ["shp","ply"]

getExportFormats

String[] getExportFormats()
Get the file extensions that can be saved by this driver

Returns:
file extension ex: ["shp","ply"]

getFormatDescription

String getFormatDescription(String format)
Parameters:
format - Format given through getImportFormats and/or getExportFormats
Returns:
The description of this format under the default Locale.An empty string if the description is not available.

exportTable

void exportTable(Connection connection,
                 String tableReference,
                 File fileName,
                 ProgressVisitor progress)
                 throws SQLException,
                        IOException
Parameters:
connection - Active connection, do not close this connection.
tableReference - [[catalog.]schema.]table reference
fileName - File path to write, if exists it may be replaced
Throws:
SQLException - Table read error
IOException - File write error

importFile

void importFile(Connection connection,
                String tableReference,
                File fileName,
                ProgressVisitor progress)
                throws SQLException,
                       IOException
Parameters:
connection - Active connection, do not close this connection.
tableReference - [[catalog.]schema.]table reference
fileName - File path to read
Throws:
SQLException - Table write error
IOException - File read error


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.