Package org.h2gis.functions.io.dbf
Class DBFDriverFunction
java.lang.Object
org.h2gis.functions.io.dbf.DBFDriverFunction
- All Implemented Interfaces:
org.h2gis.api.DriverFunction
- Author:
- Erwan Bocher, CNRS, 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DbaseFileHeaderdBaseHeaderFromMetaData(ResultSetMetaData metaData, List<Integer> retainedColumns) Create a DBF header from the columns specified in parameter.String[]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 encoding, 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[]static StringgetQuestionMark(int count) Generate the concatenation of ?static StringgetSQLColumnTypes(DbaseFileHeader header, org.h2gis.utilities.dbtypes.DBTypes dbTypes, List<org.h2.table.Column> cols) Return SQL Columns declarationString[]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 forceFileEncoding, 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
-
DBFDriverFunction
public DBFDriverFunction()
-
-
Method Details
-
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 encoding, org.h2gis.api.ProgressVisitor progress) throws SQLException, IOException - Specified by:
exportTablein interfaceorg.h2gis.api.DriverFunction- Throws:
SQLExceptionIOException
-
getFormatDescription
- Specified by:
getFormatDescriptionin interfaceorg.h2gis.api.DriverFunction
-
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
-
isSpatialFormat
- Specified by:
isSpatialFormatin 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 forceFileEncoding, 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
-
getQuestionMark
Generate the concatenation of ? characters. Used by PreparedStatement.- Parameters:
count- Number of ? character to generation- Returns:
- Value ex: "?, ?, ?"
-
getSQLColumnTypes
public static String getSQLColumnTypes(DbaseFileHeader header, org.h2gis.utilities.dbtypes.DBTypes dbTypes, List<org.h2.table.Column> cols) throws IOException Return SQL Columns declaration- Parameters:
header- DBAse file headercols- array columns that will be populated- Returns:
- Array of columns ex: ["id INTEGER", "len DOUBLE"]
- Throws:
IOException
-
dBaseHeaderFromMetaData
public static DbaseFileHeader dBaseHeaderFromMetaData(ResultSetMetaData metaData, List<Integer> retainedColumns) throws SQLException Create a DBF header from the columns specified in parameter.- Parameters:
metaData- SQL ResultSetMetadataretainedColumns- list of column indexes- Returns:
- DbfaseFileHeader instance.
- Throws:
SQLException- If one or more type are not supported by DBF
-