Replacing h2 database with some other relational database in Corda

烂漫一生 提交于 2019-12-24 08:55:25

问题


I have been using H2 database in Corda demo application, I would like to know, if we can plug-in some other relatioal database such as Oracle, Sybase etc instead of H2 database.

If yes, please share relevent link to do the same.

Thanks


回答1:


Yes it is possible to use other databases - for example we have accepted and merged a community contribution to use PostgreSQL: https://github.com/corda/corda/pull/1525 .

However, at this stage, we are only supporting other relational databases in the commercial version of Corda.




回答2:


As of V2 and V3, Corda allows the use of PostgreSQL 9.6, using PostgreSQL JDBC Driver 42.1.4. Note that this is an experimental community contribution, and is currently untested.

Here is an example node configuration block for PostgreSQL:

dataSourceProperties = {
    dataSourceClassName = "org.postgresql.ds.PGSimpleDataSource"
    dataSource.url = "jdbc:postgresql://[HOST]:[PORT]/postgres"
    dataSource.user = [USER]
    dataSource.password = [PASSWORD]
}

database = {
    transactionIsolationLevel = READ_COMMITTED
    schema = [SCHEMA]
}

You need to add this block to the node's node.conf file, found at the root of the node folder.

Note that:

  • The database.schema property is optional
  • The value of database.schema is not wrapped in double quotes and Postgres always treats it as a lower-case value (e.g. AliceCorp becomes alicecorp)


来源:https://stackoverflow.com/questions/48098008/replacing-h2-database-with-some-other-relational-database-in-corda

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!