Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8015597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:17:55+00:00 2026-06-04T20:17:55+00:00

There is a current migration in the test environment to rely on DBunit +

  • 0

There is a current migration in the test environment to rely on DBunit + HSQLDB. I am experiencing the Nextval issue. My ibatis configuration file looks like so:

<select id="selectTestKey" resultMap="integerResult">
        select nextval('test_seq') as integer
    </select>

My Spring mapping file looks like so:

<bean id="testDS" class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
        <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
        <property name="url" value="jdbc:hsqldb:mem:test;sql.syntax_pgs=true" />
        <property name="username" value="SA" />
        <property name="password" value="" />
    </bean>

Relevant Hibernate error:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error preparing statement.  Cause: org.hibernate.exception.SQLGrammarException: user lacks privilege or object not found: NEXTVAL

This works correctly against an Postgres database, yet fails against HSQLDB. The other answers on this site did not provide a solution for me.

Using the following maven config to get hsqldb:

<dependency>
    <groupId>org.hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <version>2.2.8</version>
</dependency>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:17:57+00:00Added an answer on June 4, 2026 at 8:17 pm

    NEXTVAL, etc. all work in the Posgres compatibility mode. As you can verify by double clicking the hsqldb.jar and checking in the GUI DatabaseManager with your URL, a CREATE SEQUENCE statement and your NEXTVAL statement.

    It is possible that the version of HSQLDB actually used is older than 2.2.8 and does not support the NEXTVAL feature. You can add a check to the URL, which results in connection failure if the database does not support the given syntax property.

    jdbc:hsqldb:mem:test;sql.syntax_pgs=true;check_props=true
    

    It is also possible that the full URL is not sent to HSQLDB, which would be the case if the above URL connects, but NEXTVAL does not work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to test if the current thread is holding a monitor
I know there is the current() function to retrieve the current node in XSL,
After discovering on superuser that there is no current way to add syntax highlighting
I'm trying to measure the popularity of a post but there's no current system
In textmate, when there's a current selection, I hit the key and the selection
Is there an API to get the current ASP.NET Trust Level?
Is there a way to identify the current version of IIS / using NSIS
Is there a better way extract the current revision hash in Mercurial than hg
Is there a way to get the current content of a WebView? What about
Is there a way to fetch the current reference count for an NSObject (i.e.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.