Class 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 Paliminos (UBS 2019), Erwan Bocher (CNRS)
    • 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 String[] 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
        Returns:
        The name of table formatted according the database rules
        Throws:
        SQLException
      • 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
      • check

        public static org.h2gis.api.ProgressVisitor check​(Connection connection,
                                                          String tableReference,
                                                          File fileName,
                                                          org.h2gis.api.ProgressVisitor progress)
                                                   throws SQLException
        Method to check the import and export arguments
        Parameters:
        connection - Active connection, do not close this connection.
        tableReference - Table name
        fileName - Path of the data file
        progress - Progress instance
        Returns:
        progress instance
        Throws:
        SQLException - Database issue