String configConnectionName, String password, String[] fileNameWithoutExtension, String[] keyColumns,
String sqlSchema, String sqlTablePrefix, boolean sqlOverwrite, String configTitle,
String configKeyType, String projectionSRS, String[] nullValues, boolean importDBFData, boolean append)
throws RemoteException
{
ConnectionInfo connInfo = getConnectionInfo(configConnectionName, password);
DataConfig dataConfig = getDataConfig();
if (Strings.isEmpty(sqlSchema))
throw new RemoteException("SQL schema must be specified.");
if (Strings.isEmpty(sqlTablePrefix))
throw new RemoteException("SQL table prefix must be specified.");
// use lower case sql table names (fix for mysql linux problems)
sqlTablePrefix = sqlTablePrefix.toLowerCase();
if (sqlOverwrite && !connInfo.is_superuser)
throw new RemoteException(String.format(
"User \"%s\" does not have permission to overwrite SQL tables.", configConnectionName));
String dbfTableName = sqlTablePrefix + "_dbfdata";
Connection conn = null;
int tableId = -1;
try
{
conn = connInfo.getConnection();
// store dbf data to database
if (importDBFData)
{
importDBF(
configConnectionName, password, fileNameWithoutExtension, sqlSchema, dbfTableName,