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.

2444 questions
92
votes
11 answers

View content of H2 or HSQLDB in-memory database

Is there a way to browse the content of an H2 or an HSQLDB in-memory database for viewing? For example, during a debugging session with Hibernate in order to check when the flush is executed; or to make sure the script that instantiates the DB gives…
jplandrain
  • 2,088
  • 4
  • 23
  • 21
87
votes
2 answers

Which is better H2 or HSQLDB?

HSQLDB 2.0 is soon to be released. I wonder if it will outperform H2 since, as far as I know, most users prefer H2 than HSQLDB. I am interested in the MVCC support of HSQLDB 2.0. I have learned that MVCC on H2 is still experimental. With regards to…
dexter
  • 1,789
  • 2
  • 13
  • 13
82
votes
1 answer

Huge performance difference when using group by vs distinct

I am performing some tests on a HSQLDB server with a table containing 500 000 entries. The table has no indices. There are 5000 distinct business keys. I need a list of them. Naturally I started with a DISTINCT query: SELECT DISTINCT business_key…
Martin Dimitrov
  • 4,490
  • 3
  • 40
  • 54
65
votes
1 answer

How do you reset Spring JUnit application context after a test class dirties it?

I'm using Spring 3.1.1.RELEASE, JUnit 4.8.1 and the HSQL 2.7.7 in-memory database. I have one test class annotated as @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ "classpath:test-trainingSessionServiceContext.xml"…
Dave
  • 17,420
  • 96
  • 300
  • 582
51
votes
3 answers

Best SQL browser for HSQLDB?

Whats the best browser tool for HSQLDB databases?
hawkeye
  • 31,052
  • 27
  • 133
  • 271
48
votes
5 answers

How can I wipe data from my HSQLDB after every test?

I had some JUnit tests already written in my project which used to populate data in the setup method. Now I have added maven to my project and I want to execute all test cases form maven i.e. using mvn test. The problem now is that my data base is…
Robin
  • 5,551
  • 7
  • 32
  • 33
41
votes
6 answers

Unsuccessful: alter table XXX drop constraint YYY in Hibernate/JPA/HSQLDB standalone

I am trying to run some Hibernate/JPA examples using an in-memory HSQL DB. The error message I get is the following: 13:54:21,427 ERROR SchemaExport:425 - HHH000389: Unsuccessful: alter table ReferringItem_map drop constraint…
Jérôme Verstrynge
  • 51,859
  • 84
  • 263
  • 429
40
votes
8 answers

Inspect in memory hsqldb while debugging

We're using hdsqldb in memory to run junit tests which operate against a database. The db is setup before running each test via a spring configuration. All works fine. Now when a tests fails it can be convinient to be able to inspect the values in…
Albert
  • 2,055
  • 1
  • 18
  • 23
39
votes
6 answers

How to see all the tables in an HSQLDB database?

I usually use SQLDeveloper to browse the database, but I couldn't make it work with HSQLDB and I don't know which tables are already created… I guess it's a vendor-specific question and not plain SQL, but the point is: how can I see the tables so I…
nobody
  • 393
  • 1
  • 3
  • 4
36
votes
3 answers

SQLite vs HSQLDB

What are the main differences between SQLite and HSQLDB? There are lots of applications using both of them, but I don't really see any major difference.
Jakub Arnold
  • 79,807
  • 86
  • 218
  • 314
35
votes
5 answers

How to initialize in-memory HSQLDB using script via Spring

I am attempting to do unit testing of my DAO (using Spring and Hibernate). I am using HSQLDB per this tutorial. The tutorial states that the in-memory HSQLDB database can be initialized using a SQL script but I cannot find information on how to do…
John B
  • 30,460
  • 6
  • 67
  • 92
35
votes
16 answers

HSQL database user lacks privilege or object not found error

I am trying to use hsqldb-2.3.4 to connect from Spring applicastion. I created data base using the following details Type : HSQL Database Engine Standalone Driver: org.hsqldb.jdbcDriver URL: jdbc:hsqldb:file:mydb UserName: SA Password: SA I created…
Raju Boddupalli
  • 1,549
  • 3
  • 18
  • 28
34
votes
6 answers

How do I reset my database state after each unit test without making the whole test a transaction?

I'm using Spring 3.1.1.RELEASE, Hibernate 4.1.0.Final, JPA 2, JUnit 4.8.1, and HSQL 2.2.7. I want to run some JUnit tests on my service methods, and after each test, I would like any data written to the in-memory database to be rolled back. …
Dave
  • 17,420
  • 96
  • 300
  • 582
32
votes
5 answers

"Found: bit, expected: boolean" after Hibernate 4 upgrade

I'm trying to upgrade from Hibernate 3.6.5 to 4.0 (and from Spring 3.0.5 to 3.1 which is required for Hibernate 4 support). Now, with both MySQL and HSQL, I'm running into this problem with persistent boolean fields: Caused by:…
Jonik
  • 74,291
  • 66
  • 249
  • 356
32
votes
4 answers

Create an in-memory database structure from an Oracle instance

I have an application where many "unit" tests use a real connection to an Oracle database during their execution. As you can imagine, these tests take too much time to be executed, as they need to initialize some Spring contexts, and communicate to…
Romain Linsolas
  • 73,921
  • 45
  • 197
  • 265
1
2 3
99 100