Questions tagged [h2]

H2 is a relational database management system written in Java. It can be embedded in Java applications or run in the client-server mode. H2 supports regular disk-based as well as in-memory databases.

The software is available as open source software under modified versions of the Mozilla Public License or the original Eclipse Public License. The main features of H2 are:

  • Very fast, open source, JDBC API
  • Embedded and server modes; in-memory databases
  • Browser based Console application
  • Small footprint: around 2 MB jar file size

The main author of H2 is Thomas Mueller, who also developed the Java database engine Hypersonic SQL. The name H2 stands for Hypersonic 2, however H2 does not share code with Hypersonic SQL or HSQLDB.

Wiki

Issues

API

4948 questions
2
votes
3 answers

H2 Database - Creating Indexes

I'm using the H2 database - running in embedded mode - and when my app starts up I load the H2 database with data from a mySQL database. I'm using linked tables to point to the mySQL tables. My issue is that I'm trying to speed up the time that H2…
joechip
  • 359
  • 5
  • 17
2
votes
3 answers

Mapping multiple HashMaps with same Entity keys in JPA

I have the following business model: Meal - contains name and price Menu - contains name and a set of Meals with their amounts and alternate prices (usually lower than default prices). In the past I have solved similar problems using…
alan.sambol
  • 265
  • 3
  • 14
2
votes
1 answer

Play 2 framework unit tests - java.lang.RuntimeException: DataSource user is null?

I trying to run unit tests in Play 2 application using H2 database in MySQL compatibility mode. I configured it in @Before as follow: @Before public void startApp() throws Exception { Map settings = new HashMap
kolen
  • 2,752
  • 2
  • 27
  • 35
2
votes
1 answer

How to launch H2 in server mode?

I'm trying to develop some app on H2 database, but the problem is I can't run JDBC queries and using web-interface of the database at the same time. The exception log looks as follows: org.h2.jdbc.JdbcSQLException: Database may be already in use:…
gabriel angelos
  • 349
  • 1
  • 9
  • 23
2
votes
0 answers

How to implement an In-Memory database accessible from multiple R sessions inside a JVM?

I'm writing a program that spawns multiple R sessions inside a single JVM. I need to share data between these sessions and I'm writing files (RData/txt) on to the disk for now. I did a bit of reading and found out that an in-memory database is the…
jackStinger
  • 2,035
  • 5
  • 23
  • 36
2
votes
1 answer

How to speed up a simple count operation in SORM?

I'm trying to perform a simple count operation on a large table with SORM. This works inexplicably slow. Code: case class Tests (datetime: DateTime, value:Double, second:Double) object DB extends Instance ( entities = Set() + …
Tolsi
  • 656
  • 9
  • 20
2
votes
5 answers

Selecting random rows from a big table in H2 database

I have a big table in my database (potentially millions of records) and I need to select #X random rows (let's say #X between 10 and 50) , but I need this query to be as optimal as possible. The table looks like this: CREATE TABLE sample ( id…
Luigi R. Viggiano
  • 8,659
  • 7
  • 53
  • 66
2
votes
3 answers

QueryDsl Set Schema

Using a Spring DataSource and a QueryDsl SQLQueryImpl, how do you specify the schema or set the schema? Test case is: Use querydsl-maven-plugin (2.9.0) to connect to DB2 database to generate Q-Classes specifying Spring creates a…
JJ Zabkar
  • 3,792
  • 7
  • 45
  • 65
2
votes
1 answer

How to set up a H2 embedded database in Java application for use in a small network?

Please bear with me, my knowledge of database concurrency and servers is very small. The problem: I'm working on a project that consists of a java application using an embedded H2 database. To date, this has been implemented and works as a…
Kirsty Williams
  • 340
  • 1
  • 2
  • 10
2
votes
1 answer

Unwanted JDBC messages ignore log4j configuration

I have a problem with log4j or Spring or H2 configuration. I can't seem to find the culprit. My problem is that whilst log4j's logging configuration is very strict, I still get unwanted logs from some component in the system. I use the Spring…
DrEnquinox
  • 47
  • 5
2
votes
2 answers

"Timeout trying to lock table" altering a table

When I try to alter a table got the following response: Timeout trying to lock table ; SQL statement: ALTER TABLE FOO ADD COLUMN NAME VARCHAR(200) [50200-169] HYT00/50200 (Help) H2 URL:…
Silvano Lohn
  • 41
  • 1
  • 2
2
votes
3 answers

Java H2 Database Framework

I know this is a newb question, but that's what I am so here goes. I am writing an application in java that has a lot of H2 database queries so far I have written methods that pull the data I need from the database with queries, because this is the…
Talon06
  • 1,756
  • 3
  • 27
  • 51
2
votes
2 answers

Java application that can run entirely from a DVD

I have to create a java application that can run entirely from a DVD. The application must connect with a database that will be also on the DVD. I was thinking to use an embedded database but i dont know much about them. Do i have to start the…
nick.tsilivis
  • 55
  • 2
  • 9
2
votes
1 answer

h2 lucene boost

We are trying to use H2 Lucene full text search functionality. It works great. Now we are asked to give weight for specific fields in the H2 (at index creation time, not during search). Say column 1 to have weight of 100 and column 2 would be 50 (as…
Ganesh
  • 573
  • 2
  • 13
2
votes
1 answer

PersistenceException when trying to add model after Globals.InitialData

I'm using Play Framework 2.0 (Java), but after implementing a simple InitialData in Globals, I'm having some problem. I'm using I have 2 models: User(email as ID) SomeModel(Long id as ID) And SomeModel has a field like: @ManyToOne public User…
Arruda
  • 862
  • 1
  • 12
  • 24