All Questions

Tagged with
Filter by
Sorted by
Tagged with
40votes
9answers
50kviews

Starting an H2 Database Server from Maven?

Suppose I want to create and use an H2 database for my integration tests. Maven has a command to run tests: mvn test. Is there a way to tell maven to start an H2 database server for the tests and ...
user avatar
  • 17.7k
22votes
5answers
18kviews

Tests fail when executed from maven but not from Intellij

I'm writing my unit tests using JUnit, PowerMock, Spring Test and an in-memory H2 database. When I run the tests from Intellij everything runs correctly. But when I run the tests from maven (either ...
user avatar
  • 3,847
21votes
1answer
12kviews

File based h2 persisted but not loaded in Spring Boot

I made a small application based on Spring Boot: spring-boot-starter-web spring-boot-starter-data-jpa The application has simply one domain class Post.java. Accordingly there is a RestController and ...
user avatar
  • 558
18votes
6answers
46kviews

Why I can't get the org.h2.Driver? I use maven

I face a problem about connecting to H2 this is my pom.xml: <project> <modelVersion>4.0.0</modelVersion> <groupId>.</groupId> <artifactId>dbConnection&...
user avatar
  • 181
12votes
5answers
13kviews

Cannot import org.h2.server.web.WebServlet

I am trying to configure my spring boot application to use h2 console. I found some articles and all of them use webServlet. But I can not import the class although I have h2 dependency added in my ...
user avatar
  • 3,558
10votes
3answers
4kviews

H2DB - script SQL ON UPDATE in CREATE TABLE request

How to do an ON UPDATE in a CREATE TABLE request in H2 database. Context: I'm using the sql-maven-plugin (1.5) to generate a table in an h2 database in my project. But when I call the script sql, I ...
user avatar
9votes
8answers
29kviews

H2-In memory database console not opening

I am using the H2 database in a Spring boot application. But unable to open it in the browser at http://localhost:8080/console. My pom.xml is as below: <dependency> <groupId>com....
user avatar
8votes
2answers
9kviews

H2 Database: How to have lowercase for tablename?

I want to keep all my tablenames as lowercase. example person I use Liquibase to setup my database and it looks like http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> ...
user avatar
  • 79.6k
6votes
6answers
26kviews

H2 embeded DB with spring boot error auto configuring

i'm trying to use the H2 embedded DB with spring boot. But, it throws the following errors. 2016-10-19 22:05:25.818 INFO 14104 --- [ main] com.example.SpringDemoApplication : ...
user avatar
  • 156
6votes
1answer
23kviews

Configuring H2 database via Yaml - Spring Boot

I have a spring boot app, and I want to configure my H2 database with Yaml. It crashes whenever I would run this. My app.yml file: spring: database: h2 console: true path: /h2 datasource: ...
user avatar
  • 3,095
6votes
2answers
3kviews

JUnit test starts before H2´s RUNSCRIPT finishes

We have a Java project using Spring and MAVEN. In this project, we are using H2 database in memory to perform several tests on our DAO/Repository layer. After a few tests run, BUT NOT ALWAYS, we got ...
user avatar
  • 365
5votes
2answers
6kviews

Override maven dependency scope in profile

I have spring-boot application based on maven. I want to have h2 database as dependency only for tests so I have it as follows: <dependency> <groupId>com.h2database</groupId> ...
user avatar
5votes
3answers
7kviews

Maven pulling in dependency that is not specified in POM

I have a maven project consisting of a parent POM and several sub-modules. It compiles and runs fine within Intellij (I'm assuming this uses javac and not Maven). When I run maven clean install, the ...
user avatar
  • 1,842
5votes
2answers
3kviews

Dropping H2 in memory DB between integeration tests in maven

I have the following scenario. I have an Hibernate-Spring Project, which works on mySQL on production, and uses H2 in-memory DB for integration tests, which is created on-the-fly. Currently, when I ...
user avatar
  • 25.4k
5votes
1answer
2kviews

Oracle to H2/hsqldb etc adapter

I can't be the only person who has this problem so I am looking for suggestions. We run our apps on Oracle but our integration tests use h2 for speedy in-memory testing, the database being built from ...
user avatar

15 30 50 per page
1
2 3 4 5 6