Sameer Hameed
Sameer Hameed

Reputation: 65

Replacing h2 database with some other relational database in Corda

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

Upvotes: 1

Views: 683

Answers (2)

Joel
Joel

Reputation: 23210

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)

Upvotes: 0

Richard Green
Richard Green

Reputation: 2062

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.

Upvotes: 1

Related Questions