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
1
vote
1 answer

How to change default port number (8082) of H2DB console application?

I want to use H2DB console application on Windows,Linux and AIX. Idea is to use console app provided by H2DB as database server and allow other services to use it for database access. The problem is the default port of 8082 which seems to always…
Ram
  • 1,225
  • 2
  • 24
  • 48
1
vote
2 answers

Error when implementing springboot with H2db

I am new to coding. I am getting below error when trying to run java application in springboot with H2db. [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 8.777 s <<< FAILURE! - in…
Kamal
  • 11
  • 4
1
vote
1 answer

why H2 database append prefix before my value

I have a table in H2 database. In this table there are 2 columns like below: CREATE TABLE mytable (id bigserial NOT NULL,lffo_file text); id | value -------------- I execute this query : INSERT INTO mytable (value , id) VALUES (…
Mehdi Monzavi
  • 117
  • 2
  • 8
1
vote
0 answers

Cannot browse H2 in memory database from Java EE application

I have a problem with connecting to H2 in memory DB from H2 console. I am not using the Spring - just pure Java EE. I am specifying the H2 connection string in persistence.xml file:
Adam
  • 884
  • 7
  • 29
1
vote
1 answer

H2 database not known to support REF_CURSOR parameters

I'm working on Oracle stored procedure, I have procedure and 1 parameter in - > x IN VARCHAR2, out -> REF_CURSOR in out SYS_REFCURSOR. I'm trying to call this procedure using hibernate, but i have exception I need the same but H2 database…
1
vote
1 answer

Spring Boot 2.0, H2, Unable to start app on existing H2 DB file

I am in the process of migrating my application from Spring Boot 1.4.x to 2.0.0. In our development environment we run an H2 on file db, as shown in the debug log below. I can run the app with ddl-auto: create with an in MEM db, but when trying to…
abarraford
  • 655
  • 2
  • 7
  • 23
1
vote
0 answers

liquibase and spring boot integration test h2db Table "" not found

Liquibase ran and created the tables as you can see on logs, but when Test executes the table can't be found. Caused by: org.h2.jdbc.JdbcSQLException: Table "EXAM" not found; SQL statement: select exam0_.id_exam as id_exam1_11_, exam0_.code as…
1
vote
1 answer

Get the value of an auto-increment-field within the transaction

I'm using H2DB for a litthe cuesheet-database. I'm inserting several records to a table with anj auto-increment field for the primary key ID. For each record I want to know the value of the ID-field after insert, i.e. before committing. How do I get…
user6562673
1
vote
1 answer

How to start H2 db TCP server within Spring Boot application and with flyway

I use Spring Boot and H2 db with Flyway, and I want to start the H2 db tcp server upon start of my application (written in Spring Boot). So I have such application.properties…
Tymur Berezhnoi
  • 706
  • 1
  • 14
  • 27
1
vote
0 answers

Optimize query rather than using offset,limit and order by

I am new to java and I am facing a little problem. Actually I am extracting data from table which contains 7345987 records and show them onto the jtable. Till now, I have successfully done it by using Limit and offset. My query is : ResultSet rs1 =…
Noob Player
  • 279
  • 6
  • 25
1
vote
2 answers

INSERT INTO table SELECT not working with constant values in H2 DB

Following is the H2DB query INSERT INTO userpermission (userid, permissionid, createddt, createdby, updateddt, updatedby) SELECT u.userid, p.permissionid, now(), ("1"), now(), ("1") FROM user u, permission p WHERE u.email =…
TechCrunch
  • 2,924
  • 5
  • 45
  • 79
1
vote
3 answers

How to combine two columns as one primary key sql

I have a database contain a table of id cards like this query CREATE TABLE ID_CARD ( N_CARD VARCHAR(20) NOT NULL, ISSUE_DATE DATE NOT NULL, ID_TYPE VARCHAR(2) NOT NULL, CONSTRAINT PKEY_ID_CARD PRIMARY…
A. Ilyes
  • 17
  • 1
  • 4
1
vote
0 answers

org.h2.Driver version for embedded mode

My requirement is H2 database should get started while deploying my war file in embedded mode. For that I created class(DbSetup) in my java project. I mentioned the same class in web.xml . Then I implemented contextInitialized(ServletContextEvent…
damar
  • 11
  • 1
1
vote
1 answer

How to use geography.ST_GeometryType() function in H2 database?

Teradata Query select F.farm_id, F.name, CASE WHEN geography.ST_GeometryType() = 'ST_POINT' THEN geography.ST_X() ELSE geography.ST_Centroid().ST_X() END as LNG, CASE WHEN geography.ST_GeometryType() = 'ST_POINT' THEN geography.ST_Y() ELSE…
1
vote
0 answers

H2 jdbc Connection refused: connect 90067-147

I got a project to upgrade and it is using h2 DB with jdbc driver. During the build I have a systematic error on connection: Exception in thread "main" org.h2.jdbc.JdbcSQLException: Connection is broken: "Connection refused: connect" [90067-147] at…
Hisham
  • 21
  • 1
  • 5