1 | try↵ | | 1 | try↵
|
2 | {↵ | | |
|
3 | XMLBeanReader doc = new XMLBeanReader();↵ | | |
|
4 | doc.load(new File↵ | | 2 | {↵
|
5 | (_userSettingsFolder, USER_PREFS_FILE_NAME),↵ | | 3 | SQLExecuterTask executer = new SQLExecuterTask(_se↵
|
6 | getClass().getClassLoader());↵ | | |
|
7 | final Iterator<?> it = doc.iterator();↵ | | |
|
8 | if (it.hasNext())↵ | | |
|
9 | {↵ | | |
|
10 | _prefs = (ExportConfigPreferences)it.next();↵ | | |
|
11 | }↵ | | |
|
12 | }↵ | | |
|
13 | catch (FileNotFoundException ignore)↵ | | |
|
14 | {↵ | | |
|
15 | // i18n[exportconfig.fileWillBeCreated={0} not found - will be created]↵ | | |
|
16 | s_log.info↵ | | 4 | ssion, sbScript.toString(), new DefaultSQLExecuterHandler(_session));↵
|
| | | 5 | executer.run();↵
|
|
| | | 6 | // i18n[sqlscript.successCreate=Successfully created table {0}]↵
|
17 | (s_stringMgr.getString("exportconfig.fileWillBeCreated", USER_PREFS_FILE_NAME));↵ | | 7 | _session.showMessage(s_stringMgr.getString("sqlscript.successCreate", ↵
|
18 | }↵ | | |
|
19 | ↵ | | 8 | sTable));↵
|
| | | 9 | }↵
|
20 | catch (Exception ex)↵ | | 10 | catch (Exception e)↵
|
21 | {↵ | | |
|
22 | // i18n[exportconfig.errorCreatingFile=E↵ | | 11 | {↵
|
| | | 12 | _session.showErrorMessage(e);↵
|
|
23 | rror occured reading from preferences file: {0}]↵ | | 13 | // i18n[sqlscript.storeSqlInTableFailed=An error occured during storing SQL result in table {0}↵
|
24 | s_log.error(s_stringMgr.getString("exportconfig.errorCreatingF↵ | | 14 | . See messages for details.\nI will create the copy script. You may correct errors and run it again.]↵
|
25 | ile", USER_PREFS_FILE_NAME), ex);↵ | | 15 | String msg = s_stringMgr.getString("sqlscript.storeSqlInTableFailed", ↵
|
26 | ↵ | | 16 | sTable);↵
|
| | | 17 | JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg);↵
|
27 | } | | 18 | }
|