• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

HSQL embedded database giving "user lacks privilege or object not found"

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I'm attempting to configure an embedded HSQL database in a maven/hibernate project for unit testing. For "production mode", I have configured an Oracle database, with works fine (I can add, delete, etc.).

For unit testing, I first tried specifying in the spring config file:



schema.sql contains SQL for creating all of the tables and sequences. When running, I get errors saying the tables already exist. OK, I remove that line and have just:




When I run that, I get "user lacks privilege or object not found" when attempting to insert the data found in the "test-data.sql" file. I assume that the tables do exist (since I get the first error message) and I just don't have access. The information I've seen don't seem to imply security credentials are needed for the embedded databases, but I'm not sure about that. I attempted to change the configuration passing credentials like:



But I get the same "user lacks privilege or object not found".

If I remove the jdbc:initialize-database element completely, I get the same "user lacks privilege or object not found" error as the test case is attempting to create a JPA object.


Any idea what I'm doing wrong?

 
Lonnie Lewis
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never mind, I got it to work. I needed to add "if not exists" in the creation of the elements. Not sure why, maybe the script is being executed more than once? I don't know...
 
We can walk to school together. And we can both read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic