Starting an H2 Database Server from Maven?

后端 未结 9 1804
不思量自难忘°
不思量自难忘° 2021-01-30 07:09

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 t

9条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-30 07:25

    If you want to make it in memory, then just use a different URL:

    
        
        
        
                
    
    

    You can give additional options, such as: ;DB_CLOSE_DELAY=-1

    see: http://www.h2database.com/html/features.html#in_memory_databases

提交回复
热议问题