Search in sources :

Example 1 with ImportDataFinishOneTableEvent

use of com.cubrid.common.ui.cubrid.table.dialog.imp.event.ImportDataFinishOneTableEvent in project cubrid-manager by CUBRID.

the class AbsImportRunnable method run.

public void run() {
    handleEvent(new ImportDataBeginOneTableEvent(tableName));
    try {
        performCreateTable(tableName);
    } catch (Exception e) {
        writeErrorLog("Create table failed:" + e.getMessage());
        LOGGER.error("", e);
    }
    DataType.setNULLValuesForImport(importConfig.getNullValueList().toArray(new String[importConfig.getNullValueList().size()]));
    try {
        initConnection();
        doRun();
    } catch (final Exception e) {
        handleEvent(new ImportDataTableFailedEvent(tableName));
        LOGGER.error("", e);
        Display.getDefault().syncExec(new Runnable() {

            public void run() {
                String msg = Messages.errorOpenFile + StringUtil.NEWLINE + tableConfig.getFilePath() + StringUtil.NEWLINE + StringUtil.NEWLINE + e.getMessage();
                CommonUITool.openErrorBox(msg);
            }
        });
    } finally {
        finish();
    }
    handleEvent(new ImportDataFinishOneTableEvent(tableName));
    if (progressManager != null) {
        progressManager.taskFinished(this);
    }
}
Also used : ImportDataTableFailedEvent(com.cubrid.common.ui.cubrid.table.dialog.imp.event.ImportDataTableFailedEvent) ImportDataBeginOneTableEvent(com.cubrid.common.ui.cubrid.table.dialog.imp.event.ImportDataBeginOneTableEvent) ImportDataFinishOneTableEvent(com.cubrid.common.ui.cubrid.table.dialog.imp.event.ImportDataFinishOneTableEvent) SQLException(java.sql.SQLException) DataFormatException(com.cubrid.common.ui.cubrid.table.dialog.DataFormatException) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) ParamSetException(com.cubrid.common.ui.spi.util.paramSetter.ParamSetException) UnsupportedEncodingException(java.io.UnsupportedEncodingException)

Aggregations

DataFormatException (com.cubrid.common.ui.cubrid.table.dialog.DataFormatException)1 ImportDataBeginOneTableEvent (com.cubrid.common.ui.cubrid.table.dialog.imp.event.ImportDataBeginOneTableEvent)1 ImportDataFinishOneTableEvent (com.cubrid.common.ui.cubrid.table.dialog.imp.event.ImportDataFinishOneTableEvent)1 ImportDataTableFailedEvent (com.cubrid.common.ui.cubrid.table.dialog.imp.event.ImportDataTableFailedEvent)1 ParamSetException (com.cubrid.common.ui.spi.util.paramSetter.ParamSetException)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 SQLException (java.sql.SQLException)1