3 Replies Latest reply on Jul 28, 2003 11:49 AM by Christophe Warland

    Build "distrib" failed: SQLException

    Eric Chow Newbie

      Hello,

      I got the most updated source from CVS. But it still has SQLException for the Timestamp in HSQLDB:

      assembledb:
      [sql] Executing file: D:\Projects\nukes\distrib\output\sql\setup\hsqldb.ddl
      [sql] Failed to execute: INSERT INTO nuke_journal_stats (pn_sid,pn_uid,pn_nop,pn_lp,pn_micro) VALUES (1,1,0,'2003-01-20:11:33:19','2003-01-20:11-33-19')

      BUILD FAILED

      file:D:/Projects/nukes/distrib/build.xml:188: java.sql.SQLException: Wrong data type: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff in statement [INSERT INTO nuke_journal_stats (pn_sid,pn_uid,pn_nop,pn_lp,pn_micro) VALUES (1,1,0,'2003-01-20:11:33:19','2003-01-20:11-33-19')]
      at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:406)
      at org.apache.tools.ant.Task.perform(Task.java:319)
      at org.apache.tools.ant.Target.execute(Target.java:309)
      at org.apache.tools.ant.Target.performTasks(Target.java:336)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
      at org.apache.tools.ant.Main.runBuild(Main.java:610)
      at org.apache.tools.ant.Main.start(Main.java:196)
      at org.apache.tools.ant.Main.main(Main.java:235)
      Caused by: java.sql.SQLException: Wrong data type: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff in statement [INSERT INTO nuke_journal_stats (pn_sid,pn_uid,pn_nop,pn_lp,pn_micro) VALUES (1,1,0,'2003-01-20:11:33:19','2003-01-20:11-33-19')]
      at org.hsqldb.Trace.getError(Unknown Source)
      at org.hsqldb.jdbcResultSet.(Unknown Source)
      at org.hsqldb.jdbcConnection.executeStandalone(Unknown Source)
      at org.hsqldb.jdbcConnection.execute(Unknown Source)
      at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)
      at org.hsqldb.jdbcStatement.execute(Unknown Source)
      at org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLExec.java:494)
      at org.apache.tools.ant.taskdefs.SQLExec.runStatements(SQLExec.java:470)
      at org.apache.tools.ant.taskdefs.SQLExec$Transaction.runTransaction(SQLExec.java:617)
      at org.apache.tools.ant.taskdefs.SQLExec$Transaction.access$000(SQLExec.java:580)
      at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:382)
      ... 8 more
      --- Nested Exception ---
      java.sql.SQLException: Wrong data type: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff in statement [INSERT INTO nuke_journal_stats (pn_sid,pn_uid,pn_nop,pn_lp,pn_micro) VALUES (1,1,0,'2003-01-20:11:33:19','2003-01-20:11-33-19')]
      at org.hsqldb.Trace.getError(Unknown Source)
      at org.hsqldb.jdbcResultSet.(Unknown Source)
      at org.hsqldb.jdbcConnection.executeStandalone(Unknown Source)
      at org.hsqldb.jdbcConnection.execute(Unknown Source)
      at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)
      at org.hsqldb.jdbcStatement.execute(Unknown Source)
      at org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLExec.java:494)
      at org.apache.tools.ant.taskdefs.SQLExec.runStatements(SQLExec.java:470)
      at org.apache.tools.ant.taskdefs.SQLExec$Transaction.runTransaction(SQLExec.java:617)
      at org.apache.tools.ant.taskdefs.SQLExec$Transaction.access$000(SQLExec.java:580)
      at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:382)
      at org.apache.tools.ant.Task.perform(Task.java:319)
      at org.apache.tools.ant.Target.execute(Target.java:309)
      at org.apache.tools.ant.Target.performTasks(Target.java:336)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
      at org.apache.tools.ant.Main.runBuild(Main.java:610)
      at org.apache.tools.ant.Main.start(Main.java:196)
      at org.apache.tools.ant.Main.main(Main.java:235)

        • 1. Re: Build "distrib" failed: SQLException
          Christophe Warland Newbie

          You have to edit nukes/journal/output/resources/hsqldb/setup.ddl to use right timestamp format for all SQL inserts. For example, the SQL that your build choked on should be rewritten as:

          INSERT INTO nuke_journal_stats (pn_sid,pn_uid,pn_nop,pn_lp,pn_micro) VALUES (1,1,0,'2003-01-20 11:33:19','2003-01-20 11:33:19')

          • 2. Re: Build "distrib" failed: SQLException
            Eric Chow Newbie

            Hi,

            I have rewritten the setup.ddl, but still failed.

            assembledb:
            [delete] Deleting 2 files from D:\Projects\nukes\distrib\output\sql
            [delete] Deleting D:\Projects\nukes\distrib\output\sql\default.properties
            [delete] Deleting D:\Projects\nukes\distrib\output\sql\default.script
            [sql] Executing file: D:\Projects\nukes\distrib\output\sql\setup\hsqldb.dd
            l
            [sql] Failed to execute: INSERT INTO nuke_journal_stats (pn_sid,pn_uid,pn_
            nop,pn_lp,pn_micro) VALUES (1,1,0,'2003-01-20 11:33:19','2003-01-20 11-33-19')

            BUILD FAILED
            file:D:/Projects/nukes/distrib/build.xml:188: java.sql.SQLException: Wrong data
            type in statement [INSERT INTO nuke_journal_stats (pn_sid,pn_uid,pn_nop,pn_lp,pn
            _micro) VALUES (1,1,0,'2003-01-20 11:33:19','2003-01-20 11-33-19')]




            • 3. Re: Build "distrib" failed: SQLException
              Christophe Warland Newbie

              But you need to pay close attention when you edit that file because there are many broken timestamps in it. For example, you only updated the 1st timestamp in that SQL. You didn't update the 2nd one. It should read 11:33:19 instead of 11-33-19.