Package org.h2gis.functions.io.dbf
Class DBFDriverFunction
- java.lang.Object
-
- org.h2gis.functions.io.dbf.DBFDriverFunction
-
- All Implemented Interfaces:
org.h2gis.api.DriverFunction
public class DBFDriverFunction extends Object implements org.h2gis.api.DriverFunction
- Author:
- Erwan Bocher, CNRS, Nicolas Fortin, Sylvain PALOMINOS (UBS 2019)
-
-
Field Summary
Fields Modifier and Type Field Description static StringDESCRIPTION
-
Constructor Summary
Constructors Constructor Description DBFDriverFunction()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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[]getExportFormats()StringgetFormatDescription(String format)org.h2gis.api.DriverFunction.IMPORT_DRIVER_TYPEgetImportDriverType()String[]getImportFormats()static StringgetQuestionMark(int count)Generate the concatenation of ? characters.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 Detail
-
DESCRIPTION
public static String DESCRIPTION
-
-
Method Detail
-
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
public String getFormatDescription(String format)
- 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
public String[] getImportFormats()
- Specified by:
getImportFormatsin interfaceorg.h2gis.api.DriverFunction
-
getExportFormats
public String[] getExportFormats()
- Specified by:
getExportFormatsin interfaceorg.h2gis.api.DriverFunction
-
isSpatialFormat
public boolean isSpatialFormat(String extension)
- 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
public static String getQuestionMark(int count)
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
-
-