mirror of
https://github.com/corda/corda.git
synced 2025-02-07 11:30:22 +00:00
ENT-2035 / ENT-2037 Document JDBC driver in ./drivers directory (#939)
Enterprise tarball Corda distribution can only load JDBC jars from relative ./drivers directory. The Capsule version can use directory specified by jarDirs config property and jarDirs was documented as a way to add JDBC drivers. To make it consistent between tarball and Capsule version enterprise docs will be updated to use ./drivers dir, still preserving jarDirsbut state this option is not advisable and depending on the distribution may not work.
This commit is contained in:
parent
4bb548c09b
commit
d821f6d9e3
@ -214,7 +214,10 @@ absolute path to the node's base directory.
|
||||
:jarDirs: An optional list of file system directories containing JARs to include in the classpath when launching via ``corda.jar`` only.
|
||||
Each should be a string. Only the JARs in the directories are added, not the directories themselves. This is useful
|
||||
for including JDBC drivers and the like. e.g. ``jarDirs = [ '${baseDirectory}/lib' ]`` (Note that you have to use the ``baseDirectory``
|
||||
substitution value when pointing to a relative path)
|
||||
substitution value when pointing to a relative path).
|
||||
|
||||
.. note:: The property is available for Corda distributed with Capsule only, for Corda tarball distribution the option is unavailable.
|
||||
It's advisable to copy any required JAR files to the 'drivers' subdirectory of the node base directory.
|
||||
|
||||
:sshd: If provided, node will start internal SSH server which will provide a management shell. It uses the same credentials and permissions as RPC subsystem. It has one required parameter.
|
||||
|
||||
|
@ -268,7 +268,6 @@ file that can be used for either node:
|
||||
myLegalName : "O=Corda HA, L=London, C=GB"
|
||||
keyStorePassword : "password"
|
||||
trustStorePassword : "password"
|
||||
jarDirs = ["plugins", "cordapps"]
|
||||
rpcUsers=[
|
||||
{
|
||||
user=corda
|
||||
|
@ -35,15 +35,13 @@ and Hibernate properties in `database` entry - see :ref:`Node configuration <dat
|
||||
|
||||
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.
|
||||
Corda will search for valid JDBC drivers under the ``./drivers`` subdirectory of the node base directory.
|
||||
For Corda distributions with Capsule it will also search in 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 the ``./drivers`` subdirectory,
|
||||
alternatively if applicable specify ``jarDirs`` property, as this is a list of paths, each value needs to be wrapped in single quotes e.g. `jarDirs = [ '/lib/jdbc/driver' ]`.
|
||||
|
||||
Example configuration for supported standalone databases are shown below.
|
||||
In each configuration replace placeholders `[USER]`, `[PASSWORD]`, `[SCHEMA]` (optionally), `path_to_jdbc_driver_dir` and
|
||||
others from ``dataSource.url`` with the appropriate values.
|
||||
The string `path_to_jdbc_driver_dir` needs to be wrapped by single quotes e.g. `jarDirs = [ '/lib/jdbc/driver' ]`.
|
||||
|
||||
In each configuration replace placeholders `[USER]`, `[PASSWORD]`, `[SCHEMA]` (optionally).
|
||||
|
||||
SQL Azure and SQL Server
|
||||
````````````````````````
|
||||
@ -64,15 +62,14 @@ Example node configuration for SQL Azure:
|
||||
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`
|
||||
* ``jarDirs`` specifies a path to the directory with Microsoft JDBC driver,
|
||||
* Ensure that the Microsoft JDBC driver JAR is copied to the ``./drivers`` subdirectory or if applicable specify a path in the ``jarDirs`` property,
|
||||
the 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 denoted by ``jarDirs`` contains only a single driver `mssql-jdbc-6.2.2.jre8.jar` as the archive comes with two jar versions
|
||||
extract the archive and copy the single file ``mssql-jdbc-6.2.2.jre8.jar`` as the archive comes with two JAR versions
|
||||
|
||||
Oracle
|
||||
````````````````````````
|
||||
@ -92,13 +89,12 @@ Example node configuration for Oracle:
|
||||
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`
|
||||
* ``jarDirs`` specifies a path to the directory with the relevant Oracle JDBC driver
|
||||
* Ensure that the Oracle JDBC driver JAR is copied to the ``./drivers`` subdirectory or if applicable specify path in the ``jarDirs`` property
|
||||
|
||||
.. _postgres_ref:
|
||||
|
||||
@ -120,7 +116,6 @@ Here is an example node configuration for PostgreSQL:
|
||||
transactionIsolationLevel = READ_COMMITTED
|
||||
schema = [SCHEMA]
|
||||
}
|
||||
jarDirs = ['path_to_jdbc_driver_dir']
|
||||
|
||||
Note that:
|
||||
|
||||
@ -128,4 +123,4 @@ Note that:
|
||||
* 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
|
||||
* ``jarDirs`` specifies a path to the directory with the PostgreSQL JDBC driver
|
||||
* Ensure that the PostgreSQL JDBC driver JAR is copied to the ``./drivers`` subdirectory or if applicable specify path in the ``jarDirs`` property
|
||||
|
@ -35,6 +35,10 @@ fun main(args: Array<String>) {
|
||||
System.setProperty("corda-launcher.cwd", Settings.WORKING_DIR)
|
||||
System.setProperty("user.dir", Settings.WORKING_DIR)
|
||||
|
||||
// To distinguish how Corda was started in order to create more detailed message for any discrepancies between Capsule and javapackager (tarball)
|
||||
// e.g. if JDBC driver was not found, remove once Corda started by Capsule is no longer in use
|
||||
System.setProperty("corda-distribution.tarball", "true")
|
||||
|
||||
try {
|
||||
appMain.invoke(null, args.sliceArray(1..args.lastIndex))
|
||||
} catch (e: Exception) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user