--- FM2SQL/Attic/Convert.java 2004/10/26 08:37:10 1.83 +++ FM2SQL/Attic/Convert.java 2004/10/29 10:28:10 1.85 @@ -398,6 +398,8 @@ class Convert } catch (Exception e) { + System.out.println("Warning exception occured \n " + e); + continue; } // determine destTableName from createStatement or from source @@ -506,25 +508,27 @@ class Convert catch (Exception e) { System.out.println("Error while connecting to database " + e); - if (dialog != null) + if (isGUI) { dialog.setVisible(false); dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); FM2SQL.fmInstance.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + java.io.ByteArrayOutputStream b = new java.io.ByteArrayOutputStream(); + java.io.PrintStream stream = new java.io.PrintStream(b); + stream.print(command + "\n\n"); + e.printStackTrace(stream); + FM2SQL.showErrorDialog(b.toString(), "Error occured !"); } - java.io.ByteArrayOutputStream b = new java.io.ByteArrayOutputStream(); - java.io.PrintStream stream = new java.io.PrintStream(b); - stream.print(command + "\n\n"); - e.printStackTrace(stream); - if(dialog!=null) - FM2SQL.showErrorDialog(b.toString(), "Error occured !"); + else + { + e.printStackTrace(); + } } - if (dialog != null) + if (isGUI) { dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); FM2SQL.fmInstance.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - dialog.setVisible(false); } @@ -632,7 +636,8 @@ class Convert } catch (Exception e) { - System.out.println(e); + System.out.println("Warning exception occured \n "+e); + continue; } if (destination != null) @@ -845,7 +850,7 @@ class Convert catch (Exception e) { System.out.println("Error while connecting to database " + e); - if (dialog != null) + if (isGUI) { dialog.setVisible(false); dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); @@ -862,7 +867,7 @@ class Convert } } - if (dialog != null) + if (isGUI) { dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); FM2SQL.fmInstance.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); @@ -941,7 +946,7 @@ class Convert } pstm.execute(); //stm.executeUpdate(command.toString()); - if (dialog != null) + if (isGUI) dialog.progress.setValue((int) (((double) (j + 1) / (double) rowCount) * 100.0)); // System.out.println( // (int)(((double)(j+1)/(double)result[0].size())*100.0)+" @@ -2147,6 +2152,8 @@ class Convert } catch (Exception e) { + System.out.println("Warning exception occured \n "+e); + continue; } // determine destTableName from createStatement or from source @@ -2399,7 +2406,7 @@ class Convert } private static void performSynchronize(String idField, Vector vec, String tempQuery, TreeSet linesToDelete, TreeSet linesToAppend, PreparedStatement insPst, PreparedStatement updPst, - PreparedStatement delPSt, int deltaID, String delimiter, FM2SQL.ProgressDialog dialog) throws SQLException, ParseException + PreparedStatement delPSt, int deltaID, String delimiter, FM2SQL.ProgressDialog dialog) throws SQLException, ParseException,Exception { if (dialog != null) {