Questions tagged [hsqldb]

HSQLDB (HyperSQL Database) is a relational database management system. It is written in Java.

HSQLDB (HyperSQL Database) is a relational database management system.

HSQLDB can be used inside Java application processes to serve local databases. HSQLDB also includes a database server, which allows access over the network.

Each HSQLDB instance can serve multiple databases. Each database can contain multiple schemas. The databases can be all-in-memory (mem: url) or persisted to disk (file: url). Persisted databases can use a mix of tables that are always kept in memory (MEMORY tables) and tables that are only cached in memory (CACHED tables) which can grow to many gigabytes and beyond the available memory.

HSQLDB is extremely fast, especially when used in memory, or when the database is relatively small.

HSQLDB supports a very extensive subset of the ISO Standard SQL:2011. It also features SQL syntax compatibility modes which simplify porting applications written for another database engine.

HSQLDB supports user-defined stored procedures, functions, aggregate functions, and triggers. These can be written in Java or in SQL procedural language (PSM). It also features an extensive list of built-in functions.

HSQLDB is fully multi threaded. It can operate in three different transaction models: the Two Phased Lock model (TPL), the Multiversion Concurrency Control Model (MVCC) and a mixed, pessimistic multiversion model with snapshot isolation. In each model, a transaction can run in read committed or serializable isolation levels.

HSQLDB has been around since 2001 and is supported by many Java frameworks and tools.

2521 questions
17
votes
5 answers

Spring/Hibernate/Junit example of testing DAO against HSQLDB

I'm working on trying to implement a JUnit test to check the functionality of a DAO. (The DAO will create/read a basic object/table relationship). The trouble I'm having is the persistence of the DAO (for the non-test code) is being completed…
Ryan P.
  • 855
  • 2
  • 14
  • 20
17
votes
5 answers

Hibernate 4.1 with HSQLDB gives 'data exception: string data, right truncation'

I have a very strange problem, got it when I upgraded som deps to the project. I'm now using following versions: Spring: 3.1.0.RELEASE Hibernate: 4.1.7.Final Hsqldb: 2.2.8 (org.hsqldb) I THINK the problem has to do something with the file field.…
Kronis
  • 237
  • 1
  • 2
  • 9
16
votes
5 answers

How to load mysql dump to hsqldb database?

I have a sql file that creates a database in mysql: SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; CREATE SCHEMA…
Skarab
  • 6,981
  • 13
  • 48
  • 86
16
votes
5 answers

What is the best way to launch HSQLDB for unit testing, when working with spring, maven and hibernate?

In my project I can successfully test database code. I'm using Spring, Hibernate, HSQLDB, JUnit and Maven. The catch is that currently I have to launch HSQLDB manually prior to running the tests. What is the best way to automate the launching of…
tom eustace
  • 1,241
  • 2
  • 13
  • 20
16
votes
3 answers

How do I test with DBUnit with plain JDBC and HSQLDB without facing a NoSuchTableException?

I am trying to use DBUnit with plain JDBC and HSQLDB, and can't quite get it to work -- even though I've used DBUnit with Hibernate earlier with great success. Here's the code: import java.sql.PreparedStatement; import…
neu242
  • 15,796
  • 20
  • 79
  • 114
15
votes
3 answers

How to use HSQLDB in Oracle query syntax mode?

I am trying to use HSQLDB as an embedded database in a spring application (for testing). As the target production database is Oracle, I would like to use HSQLDBs Oracle syntax mode feature. In the Spring config I use
Jan Algermissen
  • 4,930
  • 4
  • 26
  • 39
15
votes
1 answer

Boolean column in HSQLDB with default value

I have having trouble getting HSQLDB to create a table with a boolean column. It seems every time I try to specify a default, I get the exception: org.hsqldb.HsqlException: unexpected token: DEFAULT I can create this problem even with this trivial…
NickJ
  • 9,380
  • 9
  • 51
  • 74
15
votes
3 answers

How to run a HSQLDB server in memory-only mode

In the documentation of the HSQLDB is a command line statement to start a HSQLDB server (HSQLDB Doc). But there is this "file:mydb" property, so I assume its not in memory-only mode. How do I run a memory-only HSQLDB server? I ran the following but…
Juri Glass
  • 88,173
  • 8
  • 33
  • 46
15
votes
1 answer

Create a stored procedure in HSQLDB with Spring embedded databases API

I am currently trying to create a testing environment using an in-memory HSQLDB instance, created using Spring, thanks to its embedded databases support: Current set up Creation of the "data source" for my unit tests: db = new…
Marc Carré
  • 1,446
  • 13
  • 19
14
votes
2 answers

Unit test MyBatis with HSQL instead of Oracle

I would like to unit test my MyBatis persistence layer using an HSQL in-memory database. The real application uses an Oracle database. This worked fine unitl we started adding auto incremented numbers for the id columns. Oracle requires the use of a…
Luwil
  • 143
  • 1
  • 1
  • 5
14
votes
1 answer

How to create table if not exists with HSQLDB

I'm using HSQLDB for persisting a small data, in my query I want to create tables at first time and if they are not exist anymore. However with HSQLDB I cannot execute the query "CREATE TABLE XYS IF NOT EXISTS" like other dbms like mysql or…
Khoi Nguyen
  • 1,072
  • 2
  • 15
  • 32
14
votes
2 answers

Proper pagination in a JOIN select

I have a SQL statement select * from users u left join files f on u.id = f.user_id where f.mime_type = 'jpg' order by u.join_date desc limit 10 offset 10 The relationship is 1-N: user may have many files. This effectively selects the second…
Queequeg
  • 2,824
  • 8
  • 39
  • 66
13
votes
6 answers

Need to perform ORDER by Twice

I want to sort according to date first and then if date is similar then according to id..How to do that in Informix/HSQL query?
coderslay
  • 13,960
  • 31
  • 73
  • 121
13
votes
2 answers

How to export and restore HSQLDB

Does anyone know how to export HSQLDB to .sql file or something on a computer and restore on other computer.
user1036817
  • 139
  • 1
  • 1
  • 3
13
votes
6 answers

Hibernate postgresql/hsqldb TEXT column incompatibility problem

I have a problem using Hibernate and PostgreSQL for production and HSQLDB for testing. I am using top-down approach letting Hibernate create database schema. I am also using annotations; mapping part of hibernate.cfg.xml only contains lines…
Nemanja
  • 343
  • 1
  • 4
  • 7