Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE])

Satya picture Satya · Feb 9, 2011 · Viewed 9.2k times · Source

Whenever I connect to HSQLDB from my application deployed on JBoss 5.1, it throws exception as : Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: error in script file line: 1 Unexpected token UNIQUE, requires COLLATION in statement [SET DATABASE UNIQUE]) .

My HSQLDB script file reads something as below : `SET DATABASE UNIQUE NAME HSQLDB2E0BAD63B3

SET DATABASE GC 0

SET DATABASE DEFAULT RESULT MEMORY ROWS 0

SET DATABASE EVENT LOG LEVEL 0

.....`

Does anyone have idea what thos exception means or should I change something in my HSQLDB configuration?

Regards, Satya

Answer

fredt picture fredt · Feb 9, 2011

Your database files are created with version 2.x, but the version of database engine running on JBoss 5.1 is 1.8.x. You should be able to replace the hsqldb.jar in the JBoss configuration with a new version.