5,167 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-1
votes
0
answers
78
views
Spring Batch 5 doesen't load h2 script
I'm trying to run a job using Spring Batch 5 using h2 embeded db but i continue having a problem. Seems the spring batch h2 databse script isn't loaded.
This is my configuration class:
package ****....
0
votes
2
answers
148
views
H2 Database connects in IDE, but not from console or as a JAR file [duplicate]
I'm trying to make a Maven project that connects to an H2 database. In an IDE this works fine, but when executing the compiled project in the terminal, or when building the project into a JAR file and ...
2
votes
2
answers
101
views
Generic Date Add SQL that works in both MySQL and H2
select DATE_ADD(CURRENT_DATE(), INTERVAL -30 DAY)
works in MySQL.
SELECT DATEADD(‘DAY’, -30, CURRENT_DATE())
works in H2(2.2.224).
I am looking for a generic SQL solution that works in both the ...
0
votes
0
answers
100
views
Spring Boot: Exclude Maven dependency in production
I'm using Spring Boot with its profiles mechanic to configure the proper data source to use per environment. For CI and certain local development profiles, we use H2. For everything else, we use ...
0
votes
1
answer
127
views
Merge 2 rows with same primary key into 1 by adding a new column
I have a table with 2 columns:
EMPLOYER_ID
PLAN_NAME
1234
Aetna
1234
Cigna
What would be my SQL query to change it to:
EMPLOYER_ID
PLAN_NAME
PLAN_NAME2
1234
Aetna
Cigna
Basically I want to create a ...
0
votes
0
answers
73
views
unable to access h2 console with spring boot 3 app (along with spring cloud gateway)
I have a requirement to create routing to different endpoints using gateway (ended up using spring cloud gateway [reactive stack]).
Upon setting up Spring Boot 3 project with dependencies, when added ...
0
votes
1
answer
166
views
h2 db is empty on testing
I want to run tests on my app using h2 as a database but every time I attempt to run a test it shows me an exception saying that h2 db is empty. None of the related questions I`ve read helped me.
This ...
0
votes
0
answers
58
views
Database issue with Spring Boot microservice and its dedicated Cucumber integration test
We have a Java/SpringBoot RESTful microservice and an associated integration-test module that is running Cucumber steps. The problem is that when the test is run, although the Cucumber call to the API ...
0
votes
1
answer
28
views
Retrieve LOCK_TIMEOUT
Under https://www.h2database.com/html/features.html#multiple_connections, the documentation describes how to set the value of the LOCK_TIMEOUT setting (e.g. SET LOCK_TIMEOUT 1000).
However, it makes ...
0
votes
1
answer
81
views
The generation of @Id is random on the H2 database
I'm trying to use the H2 database, and using the Spring @Id and GenerationType.IDENTITY annotation. The persistence of the data is in a file inside the project's DATA folder, so, when I restart the ...
0
votes
0
answers
36
views
Spring integration test using H2 and ZonedateTime gives exception
I am writing integration test using H2 with following setup
datasource.url=jdbc:h2:mem:service;MODE=PostgreSQL;DB_CLOSE_ON_EXIT=FALSE;DATABASE_TO_LOWER=TRUE;DEFAULT_NULL_ORDERING=HIGH;INIT=RUNSCRIPT ...
0
votes
0
answers
36
views
How to easily alias existing functions?
In H2, we can use the function bit_xor_agg to perform a XOR operation on a group.
The same function exists in MySQL but is named bit_xor.
What would be the easiest way to alias/rename bit_xor_agg as ...
0
votes
1
answer
53
views
JPA/Hibernate/H2 - Entity isnt being initialized into table
I'm currently learning JPA and Hibernate through Spring Boot and I have an entity that refuses to be initialized into a table.
public class Product {
@Id
@GeneratedValue
private Long id;
...
0
votes
1
answer
225
views
Unable to open H2 database file
Always getting error when trying to open H2 db file:
"Unsupported database file version or invalid file header in file" Error code: "[90048-224] 90048/90048". I've tried different ...
0
votes
0
answers
174
views
How to re-enable keycloak admin realm?
I keep wasting time in the admin realm of my keycloak installation, so I disabled it. But apparently I should remove the settings instead, because now I can no longer login to my keycloak installation....