简体   繁体   English

H2数据库与unitils

[英]H2 database with unitils

I used the extension unitils to initialize my database with one of the data sets. 我使用扩展unitils用其中一个数据集初始化数据库。 With Mysql, HsqlDB and PostgreSql, I didn't have any problem, but with H2 I foudn problem. 使用Mysql,HsqlDB和PostgreSql,我没有任何问题,但是使用H2,我会遇到问题。 Is what somebody already tested H2 with unitils? 有人已经用unitils测试过H2吗? If so, thank you to provide the contents of unitils.properties. 如果是这样,请感谢您提供unitils.properties的内容。

below my configuration 在我的配置之下

database.driverClassName=org.h2.Driver
database.url=jdbc:h2:tcp://localhost/~/test
database.dialect=h2
database.userName=sa
database.password=
database.schemaNames=public

DatabaseModule.Transactional.value.default=disabled

updateDataBaseSchema.enabled=true

dbMaintainer.disableConstraints.enabled=false

dbMaintainer.fromScratch.enabled=true

org.unitils.dbmaintainer.script.ScriptSource.implClassName= org.unitils.dbmaintainer.script.impl.DefaultScriptSource

dbMaintainer.script.locations=./target/test-classes/database/scripts

dataSetStructureGenerator.xsd.dirName=src/test/resources/database/xsd

dbMaintainer.autoCreateExecutedScriptsTable=true

dbMaintainer.script.fileExtensions=sql,ddl

org.unitils.dbmaintainer.clean.DBCleaner.implClassName= org.unitils.dbmaintainer.clean.impl.DefaultDBCleaner

and this is the exception I get 这是我得到的例外

org.unitils.dbmaintainer.DBMaintainer - Error while initializing DbMaintainer
org.unitils.core.UnitilsException: Missing configuration for org.unitils.core.dbsupport.DbSupport.implClassName

I used unitils-dbunit 3.3 我使用unitils-dbunit 3.3

I found the solution and I return in order to share it. 我找到了解决方案,然后返回以分享它。 The last version of unitils doesn't support H2 database, for that it is necessary to implement the necessary support. 最新版本的unitils不支持H2数据库,因为有必要实施必要的支持。 I found the solution in this jira : https://unitils.atlassian.net/browse/UNI-79 我在此jira中找到了解决方案: https : //unitils.atlassian.net/browse/UNI-79

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM