/** * Read a table and write it into a shape file. * @param connection Active connection * @param fileName Shape file name or URI * @param tableReference Table name * @throws IOException * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference) throws IOException, SQLException { exportTable(connection, fileName, tableReference, null); }
/** * Copy data from Shape File into a new table in specified connection. * @param connection Active connection * @param tableReference [[catalog.]schema.]table reference * @param fileName File path of the SHP file or URI * @throws java.io.IOException * @throws java.sql.SQLException */ public static void readShape(Connection connection, String fileName, String tableReference) throws IOException, SQLException { readShape(connection, fileName, tableReference, null); }
@Override public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { importFile(connection, tableReference, fileName, progress, null); }
/** * Read a table and write it into a shape file. * @param connection Active connection * @param fileName Shape file name or URI * @param tableReference Table name or select query * Note : The select query must be enclosed in parenthesis * @param encoding File encoding * @throws IOException * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference, String encoding) throws IOException, SQLException { SHPDriverFunction shpDriverFunction = new SHPDriverFunction(); shpDriverFunction.exportTable(connection, tableReference, URIUtilities.fileFromString(fileName), new EmptyProgressVisitor(), encoding); }
@Override public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { exportTable(connection, tableReference, fileName, progress, null); }
public SHPRead() { addProperty(PROP_REMARKS, "Read a shape file and copy the content in the specified table."); }
public SHPWrite() { addProperty(PROP_REMARKS, "Transfer the content of a table into a new shape file\nCALL SHPWRITE('FILENAME', 'TABLE'[,'ENCODING'])"); }
@Override public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { importFile(connection, tableReference, fileName, progress, null); }
/** * Read a table and write it into a shape file. * @param connection Active connection * @param fileName Shape file name or URI * @param tableReference Table name * @throws IOException * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference) throws IOException, SQLException { exportTable(connection, fileName, tableReference, null); }
/** * Copy data from Shape File into a new table in specified connection. * @param connection Active connection * @param tableReference [[catalog.]schema.]table reference * @param fileName File path of the SHP file or URI * @throws java.io.IOException * @throws java.sql.SQLException */ public static void readShape(Connection connection, String fileName, String tableReference) throws IOException, SQLException { readShape(connection, fileName, tableReference, null); }
@Override public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { exportTable(connection, tableReference, fileName, progress, null); }
public SHPRead() { addProperty(PROP_REMARKS, "Read a shape file and copy the content in the specified table."); }
public SHPWrite() { addProperty(PROP_REMARKS, "Transfer the content of a table into a new shape file\nCALL SHPWRITE('FILENAME', 'TABLE'[,'ENCODING'])"); }
@Override public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { importFile(connection, tableReference, fileName, progress, null); }
/** * Read a table and write it into a shape file. * @param connection Active connection * @param fileName Shape file name or URI * @param tableReference Table name * @throws IOException * @throws SQLException */ public static void exportTable(Connection connection, String fileName, String tableReference) throws IOException, SQLException { exportTable(connection, fileName, tableReference, null); }
/** * Copy data from Shape File into a new table in specified connection. * @param connection Active connection * @param tableReference [[catalog.]schema.]table reference * @param fileName File path of the SHP file or URI * @throws java.io.IOException * @throws java.sql.SQLException */ public static void readShape(Connection connection, String fileName, String tableReference) throws IOException, SQLException { readShape(connection, fileName, tableReference, null); }
@Override public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress) throws SQLException, IOException { exportTable(connection, tableReference, fileName, progress, null); }
public SHPRead() { addProperty(PROP_REMARKS, "Read a shape file and copy the content in the specified table."); }
public SHPWrite() { addProperty(PROP_REMARKS, "Transfer the content of a table into a new shape file\nCALL SHPWRITE('FILENAME', 'TABLE'[,'ENCODING'])"); }
@Override public void importFile(Connection connection, String tableReference, File fileName, ProgressVisitor progress, boolean deleteTables) throws SQLException, IOException { if(deleteTables) { final boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData()); TableLocation requestedTable = TableLocation.parse(tableReference, isH2); String table = requestedTable.getTable(); Statement stmt = connection.createStatement(); stmt.execute("DROP TABLE IF EXISTS " + table); stmt.close(); } importFile(connection, tableReference, fileName, progress); }