Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

HSQLDB insert issue  RSS feed

Ranch Hand
Posts: 128
Java jQuery Spring
  • 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(
at HSQLDBCrud.main(
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: 5477
Android Firefox Browser Mac OS X Safari Tomcat Server VI Editor
  • 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?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!