About
This howto shows you how to create a connection to an oracle database.
Attributes
An oracle connection supports :
-
- Uri,
- user,
- …
- and all relational connection attributes
- Driver (Jdbc Class)
- …
Example
Here are the attributes of the howto connection
comment: The howto oracle connection
driver: oracle.jdbc.OracleDriver
login-statements: ALTER SESSION SET CURRENT_SCHEMA = tabulify
name-quoting-enabled: false
password: oracle
uri: jdbc:oracle:thin:@localhost:1521/freepdb1
user: system
How to create
You can create an Oracle connection:
- by directly modifying the configuration_vault
- or by using the tabul_command
Secret
In this howto, the password is expected to be stored in the MY_ORACLE_PASSWORD OS environment variable but there is more way to provide secrets.
To know how to pass and handle secrets, read more at Secret Value
Configuration Vault
In a Configuration Vault, to define a Oracle connection with the name myOracle, you would write:
connections:
myOracle:
uri: jdbc:oracle:thin:@[host]:[port]/[servicename]
# driver is optional
driver: oracle.jdbc.OracleDriver
user: loginUser
password: ${MY_ORACLE_PASSWORD}
natives:
# https://docs.oracle.com/en/database/oracle/oracle-database/23/odpnt/ConnectionProperties.html
clientId: tabulify
Tabul Command
With the tabul add command of the connection module, you can add a Oracle connection with the name oracleConnectionName:
tabul connection add "oracleConnectionName" \
"jdbc:oracle:thin:@[host]:[port]/[servicename]" \
--user login \
--password '${MY_ORACLE_PASSWORD}'
tabul connection add "oracleConnectionName" "jdbc:oracle:thin:@[host]:[port]/[servicename]" ^
--user login ^
--password '${MY_ORACLE_PASSWORD}'