--- FM2SQL/Attic/Convert.java 2004/10/26 08:37:10 1.83 +++ FM2SQL/Attic/Convert.java 2004/10/28 08:44:04 1.84 @@ -506,25 +506,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); } @@ -845,7 +847,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 +864,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 +943,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)+"