--- FM2SQL/Attic/FM2SQL.java 2004/03/15 12:52:00 1.32 +++ FM2SQL/Attic/FM2SQL.java 2004/04/05 10:14:01 1.34 @@ -1,3 +1,17 @@ +/* + * FM2SQL.java -- Main program Filemaker to SQL Converter + * Copyright (C) 2003 Robert Gordesch (rogo@mpiwg-berlin.mpg.de) + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. Please read license.txt for the full details. A copy of + * the GPL may be found at http://www.gnu.org/copyleft/lgpl.html You should + * have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA Created on 15.09.2003 by + * rogo + */ + import java.awt.Cursor; import java.awt.Dimension; import java.awt.Font; @@ -1069,7 +1083,7 @@ public class FM2SQL extends JFrame imple } public boolean showTable(int list) { - ProgressDialog dialog = new ProgressDialog(fm); + ProgressDialog dialog = new ProgressDialog(fm,bean); dialog.setTitle("Preparing tables to be displayed"); dialog.thread = Thread.currentThread(); dialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); @@ -1472,9 +1486,12 @@ public class FM2SQL extends JFrame imple JProgressBar progress = new JProgressBar(); JButton cancel = new JButton("Cancel"); Thread thread; - public ProgressDialog(JFrame frame) + DBBean bean; + public ProgressDialog(JFrame frame,DBBean bean) { super(frame); + this.bean = bean; + content = new JPanel(true); //content.setBorder(BorderFactory.createRaisedBevelBorder()); content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS)); @@ -1509,6 +1526,18 @@ public class FM2SQL extends JFrame imple fmInstance.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); fmInstance.setEnabled(true); setVisible(false); + try + { + ProgressDialog.this.bean.getConnection().close(); + } catch (SQLException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (Exception e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } thread.stop(); } });