/** * 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); }
/** * 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); }
/** * 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); }
/** * Copy data from Shape File into a new table in specified connection. * The newly created table is given the same name as the filename * without the ".shp" extension. If such a table already exists, an * exception is thrown. * * @param connection Active connection * @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) throws IOException, SQLException { final String name = URIUtilities.fileFromString(fileName).getName(); readShape(connection, fileName, name.substring(0, name.lastIndexOf(".")).toUpperCase()); } }
/** * Copy data from Shape File into a new table in specified connection. * The newly created table is given the same name as the filename * without the ".shp" extension. If such a table already exists, an * exception is thrown. * * @param connection Active connection * @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) throws IOException, SQLException { final String name = URIUtilities.fileFromString(fileName).getName(); readShape(connection, fileName, name.substring(0, name.lastIndexOf(".")).toUpperCase()); } }
/** * Copy data from Shape File into a new table in specified connection. * The newly created table is given the same name as the filename * without the ".shp" extension. If such a table already exists, an * exception is thrown. * * @param connection Active connection * @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) throws IOException, SQLException { final String name = URIUtilities.fileFromString(fileName).getName(); String tableName = name.substring(0, name.lastIndexOf(".")).toUpperCase(); if (tableName.matches("^[a-zA-Z][a-zA-Z0-9_]*$")) { readShape(connection, fileName, tableName); } else { throw new SQLException("The file name contains unsupported characters"); } } }