Questions tagged [h2db]

H2 is an open source SQL database engine 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 disk footprint (size of the jar file) is about 1 MB.

H2 is an open source SQL database engine 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 disk footprint (size of the jar file) is about 1 MB.

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.

This tag is synonym for H2 tag

Wiki

Issues

93 questions
20
votes
3 answers

How to show content of local h2 database(web console)?

Recently I joined a new team and here guys use h2 for stub service. I was wondering whether I can show the content of this database using web interface. At work it is available by going to localhost:5080 I have a project where I use h2 database, but…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
11
votes
1 answer

H2 db 'Chunk no longer exists' error

When I'm trying to add a new row to db "INSERT INTO invited_users VALUES('id', user_name')" I'm getting this error: General error: "java.lang.IllegalStateException: Chunk 2089 no longer exists [1.4.181/9]" Probably it's some problems with db,…
iceone213
  • 1,141
  • 1
  • 11
  • 22
10
votes
1 answer

Unable to get results from H2 db

I'm trying to get values from h2 db, but always getting this error org.h2.jdbc.JdbcSQLException: No data is available [2000-171] at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) at…
iceone213
  • 1,141
  • 1
  • 11
  • 22
8
votes
4 answers

how to reslove wrong username and password error in h2 database and springboot?

Properties used in application.properties server.port=8085 spring.datasource.url=jdbc:h2:~/test spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=root spring.datasource.password=root…
Anil
  • 81
  • 1
  • 3
6
votes
1 answer

Hibernate throws org.hibernate.persister.entity.SingleTableEntityPersister

I am using JBoss AS 7 with H2 database. I have a standalone application that tries to connect to this database like this. My config file:
AnNaSF
  • 165
  • 1
  • 10
5
votes
1 answer

Saving large files in h2 database

I recently updated the h2 database in my springboot project to 2.1.210. This induced some problems, most of them I was able to fix myself. The one that I can't fix is about saving large files in the database. When I try to upload a ~3,5MB file, I…
Bjonic
  • 192
  • 12
4
votes
1 answer

Insert data in h2 database through data.sql file before performing unit testing in spring boot

I want to perform unit testing in spring boot+ JPA. For that I created configuration file to create bean for dataSource, all hibernate properties, entityManagerFactory and transactionManager. Everything going perfect. Tables are getting created by…
Omkar Patil
  • 203
  • 1
  • 3
  • 10
4
votes
1 answer

MySQL function 'HEX' in H2 / Derby / HSQL

I'm trying to unit test sql queries using an in-memory db. The queries make use of the MySQL in-built function 'hex' and 'unhex' (because they write binary data to the DB). Turns out neither of these 3 in-momery DB solutions support the 'hex'…
Gagan
  • 135
  • 1
  • 1
  • 11
4
votes
1 answer

Default url and credentials for H2DB?

I have added H2DB in my springBoot application for unit testing purpose. In application-test.properties I just added: spring.datasource.name = h2db spring.h2.console.enabled = true Its working fine, saving the values. But how it is working and how…
Sharad
  • 589
  • 5
  • 19
3
votes
0 answers

How to run h2 db as standalone server with custom username/password?

I have used h2 db as an embedded database for some java applications in the past but this time I would like to run it as a standalone server (tcp) to which I can connect from another client changing the default user and password I downloaded h2db,…
2
votes
2 answers

H2 database DbException - Unsupported connection setting "MULTI_THREADED"

Recently, I upgraded the ignite version to 2.10.0. This needs the upgrade on H2 database as well because H2 has a hard dependency on ignite. So I updated the H2 database to 1.4.200. Since then my test cases are failing. Error logs:- Caused by:…
sjain
  • 23,126
  • 28
  • 107
  • 185
2
votes
2 answers

Is it bad practice to use h2db for integration test in a spring boot context?

in our team recently the question was raised if using h2db for integration tests is a bad practice/should be avoided if the production environment relies on a different database engine, in our case MySQL8. I'm not sure if I agree with that,…
Jakob
  • 778
  • 3
  • 9
  • 25
2
votes
1 answer

H2 vs PostgreSQL generated column with function

I'm trying to setup a generated column which will also take null checks into consideration when subtracting values. In PostgreSQL I did: ALTER TABLE session ADD COLUMN duration INTERVAL GENERATED ALWAYS AS age(time_ended, time_started)…
agilob
  • 6,082
  • 3
  • 33
  • 49
2
votes
1 answer

H2 Embedded db need to change permission of database file h2db.mv.db through java

Can we change the permission of h2db.mv.db file. Right now it is set to 664 need to change to 770 through java code.
Shubham kapoor
  • 394
  • 3
  • 18
2
votes
1 answer

Write custom H2 DB function Java

I am trying to run the below code using H2DB (via junit test), while doing so i get error message as below. I understand that, there are no function available as "days" in H2. So i am trying to write a custom function, but it does not work out, can…
user2000189
  • 479
  • 4
  • 6
  • 22
1
2 3 4 5 6 7