Fix database doc - SQL Server / Azure and PostgreSQL (#539)

Fixed wrong configuration example for SQL Server / Azure, fixed duplicated and conflicting PostgreSQL instructions after merge from OS.
This commit is contained in:
szymonsztuka 2018-03-13 11:31:25 +01:00 committed by GitHub
parent 6b80072b18
commit 98f554c08d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 23 deletions

View File

@ -31,38 +31,43 @@ Standalone database
To run a node against a remote database modify node JDBC connection properties in `dataSourceProperties` entry
and Hibernate properties in `database` entry - see :ref:`Node configuration <database_properties_ref>`.
Corda will search for valid JDBC drivers either under the ``./plugins`` subdirectory of the node base directory or in one
The Corda distribution does not include any JDBC drivers with the exception of the H2 driver used by samples.
It is the responsibility of the node administrator to download the appropriate JDBC drivers and configure the database settings.
Corda will search for valid JDBC drivers either under the ``./drivers`` subdirectory of the node base directory or in one
of the paths specified by the ``jarDirs`` field of the node configuration. Please make sure a ``jar`` file containing drivers
supporting the database in use is present in one of these locations.
SQL Azure and SQL Server
````````````````````````
Corda has been tested with SQL Server 2017 (14.0.3006.16) and Azure SQL (12.0.2000.8), using Microsoft JDBC Driver 6.2.
The minimum transaction isolation level ``database.transactionIsolationLevel`` is 'READ_COMMITTED'.
The property ``database.schema`` is optional.
Example node configuration for SQL Azure:
.. sourcecode:: groovy
dataSourceProperties {
dataSourceProperties = {
dataSourceClassName = "com.microsoft.sqlserver.jdbc.SQLServerDataSource"
dataSourceProperties.dataSource.url = "jdbc:sqlserver://[DATABASE_SERVER].database.windows.net:1433;databaseName=[DATABASE];
dataSource.url = "jdbc:sqlserver://[DATABASE_SERVER].database.windows.net:1433;databaseName=[DATABASE];
encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30"
dataSourceProperties.dataSource.user = [USER]
dataSourceProperties.dataSource.password = [PASSWORD]
dataSource.user = [USER]
dataSource.password = [PASSWORD]
}
database {
database = {
transactionIsolationLevel = READ_COMMITTED
schema = [SCHEMA]
}
jarDirs = [PATH_TO_JDBC_DRIVER_DIR]
Note that:
* The ``database.schema`` property is optional
* The minimum transaction isolation level ``database.transactionIsolationLevel`` is `READ_COMMITTED`
* The JDBC driver can be downloaded from `Microsoft Download Center <https://www.microsoft.com/en-us/download/details.aspx?id=55539>`_,
extract the archive and ensure the directory ``jarDirs`` contains only one driver `mssql-jdbc-6.2.2.jre8.jar` as the archive comes with two jar versions
Oracle
````````````````````````
Corda supports Oracle 11g RC2 (with ojdbc6.jar) and Oracle 12c (ojdbc8.jar).
The minimum transaction isolation level ``database.transactionIsolationLevel`` is 'READ_COMMITTED'.
The property ``database.schema`` is optional.
Example node configuration for Oracle:
@ -79,22 +84,18 @@ Example node configuration for Oracle:
schema = [SCHEMA]
}
jarDirs = [PATH_TO_JDBC_DRIVER_DIR]
Note that:
* The ``database.schema`` property is optional
* The minimum transaction isolation level ``database.transactionIsolationLevel`` is `READ_COMMITTED`
.. _postgres_ref:
PostgreSQL
````````````````````````
Corda has been tested on PostgreSQL 9.6 database, using PostgreSQL JDBC Driver 42.1.4.
The property ``database.schema`` is optional. The value of ``database.schema`` is automatically wrapped in double quotes
to preserve case-sensitivity (e.g. `AliceCorp` becomes `"AliceCorp"`, without quotes PostgresSQL would treat the value as `alicecorp`).
Example node configuration for PostgreSQL:
=======
PostgreSQL
----------
Nodes also support PostgreSQL 9.6, using PostgreSQL JDBC Driver 42.1.4.
Configuration
~~~~~~~~~~~~~
Here is an example node configuration for PostgreSQL:
.. sourcecode:: groovy
@ -114,5 +115,6 @@ Here is an example node configuration for PostgreSQL:
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``)
* The value of ``database.schema`` is automatically wrapped in double quotes to preserve case-sensitivity
(e.g. `AliceCorp` becomes `"AliceCorp"`, without quotes PostgresSQL would treat the value as `alicecorp`),
this behaviour differs from Corda Open Source where the value is not wrapped in double quotes

View File

@ -8,4 +8,4 @@ database = {
transactionIsolationLevel = READ_COMMITTED
schema = ${custom.nodeOrganizationName}
runMigration = true
}
}