Results 1 to 2 of 2

Thread: Trouble running the Spring MVC step by step sample

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    4

    Default Trouble running the Spring MVC step by step sample

    I am trying to run the step by step sample of a spring application.
    Everything is working fine until here. http://www.springframework.org/docs/...ep-Part-4.html
    I am stuck on the hsql database part. I included the hsqldb.jar in my library /WEB-INB/lib.
    I tried to run the createTables ant script which shows successfully executed.

    Buildfile: C:\Program Files\eclipse\workspace\springapp\build.xml
    createTables:
    [echo] CREATE TABLES USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
    [sql] Executing commands
    [sql] 2 of 2 SQL statements executed successfully

    Next I tried to run the loadData script which gives the following error

    [sql] Failed to execute: INSERT INTO products (id, description, price) values(1, 'Lamp', 5.78)
    [sql] java.sql.SQLException: Table not found in statement [ INSERT INTO products]
    [sql] Failed to execute: INSERT INTO products (id, description, price) values(2, 'Table', 75.29)
    [sql] java.sql.SQLException: Table not found in statement [ INSERT INTO products]
    [sql] Failed to execute: INSERT INTO products (id, description, price) values(3, 'Chair', 22.81); COMMIT; SHUTDOWN
    [sql] java.sql.SQLException: Table not found in statement [ INSERT INTO products]

    I have never worked on the hsql database before. Is there anything additional I have to do beyond the steps mentioned in the sample steps.

    Please tell me what I need to do to run hsql db.

    Regs
    Thomas

  2. #2
    Join Date
    Nov 2006
    Posts
    1

    Default Solution

    Hello Regs,
    I had the same error. To resolve it, I ran
    'ant createTables loadData printData' all together instead of one after the other and it worked. Either from the command line or from eclipse (right click on build.xml, choose Run As, pick "2. Ant Build..." and check all three targets).

    createTables:
    [echo] CREATE TABLES USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
    [sql] Executing commands
    [sql] 2 of 2 SQL statements executed successfully
    loadData:
    [echo] LOAD DATA USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
    [sql] Executing commands
    [sql] 5 of 5 SQL statements executed successfully
    printData:
    [echo] PRINT DATA USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
    [sql] Executing commands
    [sql] ID,DESCRIPTION,PRICE
    [sql] 1,Lamp,5.78
    [sql] 2,Table,75.29
    [sql] 3,Chair,22.81
    [sql] 0 rows affected
    [sql] 1 of 1 SQL statements executed successfully
    BUILD SUCCESSFUL

    Good luck.

    Pat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •