org.h2gis.functions.io

## Class DriverManager

- java.lang.Object
- - org.h2gis.api.AbstractFunction
  - - org.h2gis.functions.io.DriverManager

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

    public class DriverManager
    extends org.h2gis.api.AbstractFunction
    implements org.h2gis.api.ScalarFunction, org.h2gis.api.DriverFunction

Manage additional table engines in H2. Use the appropriate driver to open a specified file path.

Author:
  Nicolas Fortin, 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 inherited from interface org.h2gis.api.ScalarFunction

`PROP_DETERMINISTIC, PROP_NOBUFFER`

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

`PROP_NAME, PROP_REMARKS`

### Constructor Summary

Constructors
Constructor and Description
`DriverManager()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `exportTable(Connection connection, String tableReference, File fileName, org.h2gis.api.ProgressVisitor progress)`
`void` `exportTable(Connection connection, String tableReference, File fileName, org.h2gis.api.ProgressVisitor progress, String options)`
`String[]` `getExportFormats()`
`String` `getFormatDescription(String format)`
`org.h2gis.api.DriverFunction.IMPORT_DRIVER_TYPE` `getImportDriverType()`
`String[]` `getImportFormats()`
`String` `getJavaStaticMethod()`
`void` `importFile(Connection connection, String tableReference, File fileName, org.h2gis.api.ProgressVisitor progress)`
`void` `importFile(Connection connection, String tableReference, File fileName, org.h2gis.api.ProgressVisitor progress, boolean deleteTables)`
`void` `importFile(Connection connection, String tableReference, File fileName, org.h2gis.api.ProgressVisitor progress, String options)`
`boolean` `isSpatialFormat(String extension)`
`static void` `openFile(Connection connection, String fileName, String tableName)` Create a new table

### 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

#### DriverManager

    public DriverManager()

### Method Detail

#### getJavaStaticMethod

    public String getJavaStaticMethod()

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

#### getFormatDescription

    public String getFormatDescription(String format)

Specified by:
  `getFormatDescription` in interface `org.h2gis.api.DriverFunction`

#### isSpatialFormat

    public boolean isSpatialFormat(String extension)

Specified by:
  `isSpatialFormat` in interface `org.h2gis.api.DriverFunction`

#### openFile

    public static void openFile(Connection connection,
                                String fileName,
                                String tableName)
                         throws SQLException

Create a new table

Parameters:
  `connection` - Active connection, do not close this connection.
  `fileName` - File path to write, if exists it may be replaced
  `tableName` - [[catalog.]schema.]table reference
Throws:
  `SQLException`

#### exportTable

    public void exportTable(Connection connection,
                            String tableReference,
                            File fileName,
                            org.h2gis.api.ProgressVisitor progress)
                     throws SQLException,
                            IOException

Specified by:
  `exportTable` in interface `org.h2gis.api.DriverFunction`
Throws:
  `SQLException`
  `IOException`

#### exportTable

    public void exportTable(Connection connection,
                            String tableReference,
                            File fileName,
                            org.h2gis.api.ProgressVisitor progress,
                            String options)
                     throws SQLException,
                            IOException

Specified by:
  `exportTable` in interface `org.h2gis.api.DriverFunction`
Throws:
  `SQLException`
  `IOException`

#### getImportDriverType

    public org.h2gis.api.DriverFunction.IMPORT_DRIVER_TYPE getImportDriverType()

Specified by:
  `getImportDriverType` in interface `org.h2gis.api.DriverFunction`

#### getImportFormats

    public String[] getImportFormats()

Specified by:
  `getImportFormats` in interface `org.h2gis.api.DriverFunction`

#### getExportFormats

    public String[] getExportFormats()

Specified by:
  `getExportFormats` in interface `org.h2gis.api.DriverFunction`

#### importFile

    public void importFile(Connection connection,
                           String tableReference,
                           File fileName,
                           org.h2gis.api.ProgressVisitor progress)
                    throws SQLException,
                           IOException

Specified by:
  `importFile` in interface `org.h2gis.api.DriverFunction`
Throws:
  `SQLException`
  `IOException`

#### importFile

    public void importFile(Connection connection,
                           String tableReference,
                           File fileName,
                           org.h2gis.api.ProgressVisitor progress,
                           String options)
                    throws SQLException,
                           IOException

Specified by:
  `importFile` in interface `org.h2gis.api.DriverFunction`
Throws:
  `SQLException`
  `IOException`

#### importFile

    public void importFile(Connection connection,
                           String tableReference,
                           File fileName,
                           org.h2gis.api.ProgressVisitor progress,
                           boolean deleteTables)
                    throws SQLException,
                           IOException

Specified by:
  `importFile` in interface `org.h2gis.api.DriverFunction`
Throws:
  `SQLException`
  `IOException`