• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
  • Tim Holloway
  • Carey Brown
  • salvin francis

HSQLDB insert issue

Ranch Hand
Posts: 128
jQuery Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Just started working on HSQLDB. The insert statement wont work. I am creating memory(mem) db for HSQLDB.
Can somebody help:
HSQLDB created:

HSQLDB - Table created

Connection to DB:

Prepared statement code:

After running this code, it is showing below error:

HSQLDB JDBCDriver Loaded
HSQLDB Connection Created
Connection Obtained
java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: TOKENS in statement [insert into tokens(TOKEN) values (?)]
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
at HSQLDBCrud.insertToken(HSQLDBCrud.java:18)
at HSQLDBCrud.main(HSQLDBCrud.java:31)
Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: TOKENS
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.ParserDQL.readTableName(Unknown Source)
at org.hsqldb.ParserDQL.readRangeVariableForDataChange(Unknown Source)
at org.hsqldb.ParserDML.compileInsertStatement(Unknown Source)
at org.hsqldb.ParserCommand.compilePart(Unknown Source)
at org.hsqldb.ParserCommand.compileStatement(Unknown Source)
at org.hsqldb.Session.compileStatement(Unknown Source)
at org.hsqldb.StatementManager.compile(Unknown Source)
at org.hsqldb.Session.execute(Unknown Source)
... 4 more

I am using HSQLDB 2.4.1 version.

Saloon Keeper
Posts: 5775
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check the script file that Hsqldb creates to see whether the table declaration is in there?

Can you query that table?
Bras cause cancer. And tiny ads:
Enterprise-grade Excel API for Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!