Author: jfuerth
Date: Tue May 19 15:28:08 2009
New Revision: 3052

Modified:
   trunk/src/ca/sqlpower/architect/swingui/DataMoverPanel.java

Log:
Improvement to error message so we can see the text of the query that failed.

Modified: trunk/src/ca/sqlpower/architect/swingui/DataMoverPanel.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/DataMoverPanel.java (original)
+++ trunk/src/ca/sqlpower/architect/swingui/DataMoverPanel.java Tue May 19 15:28:08 2009
@@ -282,11 +282,15 @@
DDLGenerator ddlg = DDLUtils.createDDLGenerator(destDB.getDataSource()); ddlg.generateDDLStatements(Collections.singletonList(destTable));
                 Statement stmt = null;
+                String sql = null;
                 try {
                     stmt = destCon.createStatement();
                     for (DDLStatement ddlstmt : ddlg.getDdlStatements()) {
-                        stmt.executeUpdate(ddlstmt.getSQLText());
+                        sql = ddlstmt.getSQLText();
+                        stmt.executeUpdate(sql);
                     }
+                } catch (SQLException ex) {
+ throw new RuntimeException("DDL statement failed: " + sql, ex);
                 } finally {
                     if (stmt != null) stmt.close();
                 }

Reply via email to