Package 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.Function
PROP_NAME, PROP_REMARKSFields inherited from interface org.h2gis.api.ScalarFunction
PROP_DETERMINISTIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.h2gis.api.ProgressVisitorcheck(Connection connection, String tableReference, File fileName, org.h2gis.api.ProgressVisitor progress) Method to check the import and export argumentsString[]exportTable(Connection connection, String tableReference, File fileName, boolean deleteFiles, org.h2gis.api.ProgressVisitor progress) String[]exportTable(Connection connection, String tableReference, File fileName, String options, boolean deleteFiles, org.h2gis.api.ProgressVisitor progress) String[]exportTable(Connection connection, String tableReference, File fileName, String options, org.h2gis.api.ProgressVisitor progress) String[]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) static String[]openFile(Connection connection, String fileName, String tableName) Create a new tableMethods inherited from class org.h2gis.api.AbstractFunction
addProperty, getProperty, removePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.h2gis.api.Function
getProperty
-
Constructor Details
-
DriverManager
public DriverManager()
-
-
Method Details
-
getJavaStaticMethod
- Specified by:
getJavaStaticMethodin interfaceorg.h2gis.api.ScalarFunction
-
getFormatDescription
- Specified by:
getFormatDescriptionin interfaceorg.h2gis.api.DriverFunction
-
isSpatialFormat
- Specified by:
isSpatialFormatin interfaceorg.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 replacedtableName- [[catalog.]schema.]table reference- Returns:
- The name of table formatted according the database rules
- Throws:
SQLException
-
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 options, 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 options, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException - Specified by:
exportTablein interfaceorg.h2gis.api.DriverFunction- Throws:
SQLExceptionIOException
-
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
-
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
-
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-tableReference-fileName-progress-- Returns:
- Throws:
SQLException
-