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