Skip to content

Commit

Permalink
Add support for TCPS based connection string to support SSL/TLS conne…
Browse files Browse the repository at this point in the history
…ction.
  • Loading branch information
Vipinofficial11 committed Sep 24, 2024
1 parent a83eaac commit 6a28f9d
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion oracle-plugin/docs/Oracle-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Properties

**Port:** Port that Oracle is running on.

**Connection Type** Whether to use an SID, Service Name, or TNS Connect Descriptor when connecting to the database.
**Connection Type** Whether to use an SID, Service Name, TNS Connect Descriptor, or TLS when connecting to the database.

**SID/Service Name/TNS Connect Descriptor:** Oracle connection point (Database name, Service name, or a TNS Connect Descriptor). When using TNS, place
the full TNS Connect Descriptor in the text field. For example:
Expand Down
2 changes: 1 addition & 1 deletion oracle-plugin/docs/Oracle-batchsink.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You also can use the macro function ${conn(connection-name)}.
- TRANSACTION_SERIALIZABLE (default): No dirty reads. Non-repeatable and phantom reads are prevented.
- Note: If the user role selected is SYSDBA or SYSOPER, the plugin will default to TRANSACTION_READ_COMMITTED to prevent ORA-08178 errors

**Connection Type** Whether to use an SID, Service Name, or TNS Connect Descriptor when connecting to the database.
**Connection Type** Whether to use an SID, Service Name, TNS Connect Descriptor, or TLS when connecting to the database.

**SID/Service Name/TNS Connect Descriptor:** Oracle connection point (Database name, Service name, or a TNS Connect Descriptor). When using TNS, place
the full TNS Connect Descriptor in the text field. For example:
Expand Down
2 changes: 1 addition & 1 deletion oracle-plugin/docs/Oracle-batchsource.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You also can use the macro function ${conn(connection-name)}.

**Port:** Port that Oracle is running on.

**Connection Type** Whether to use an SID, Service Name, or TNS Connect Descriptor when connecting to the database.
**Connection Type** Whether to use an SID, Service Name, TNS Connect Descriptor, or TLS when connecting to the database.

**SID/Service Name/TNS Connect Descriptor:** Oracle connection point (Database name, Service name, or a TNS Connect Descriptor). When using TNS, place
the full TNS Connect Descriptor in the text field. For example:
Expand Down
2 changes: 1 addition & 1 deletion oracle-plugin/docs/Oracle-connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ authentication. Optional for databases that do not require authentication.

**Password:** Password to use to connect to the specified database.

**Connection Type** Whether to use an SID, Service Name, or TNS Connect Descriptor when connecting to the database.
**Connection Type** Whether to use an SID, Service Name, TNS Connect Descriptor, or TLS when connecting to the database.

**SID/Service Name/TNS Connect Descriptor:** Oracle connection point (Database name, Service name, or a TNS Connect Descriptor). When using TNS, place
the full TNS Connect Descriptor in the text field. For example:
Expand Down
2 changes: 1 addition & 1 deletion oracle-plugin/docs/Oracle-postaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If set to 'failure', the action will only be executed if the pipeline run failed

**Port:** Port that Oracle is running on.

**Connection Type** Whether to use an SID, Service Name, or TNS Connect Descriptor when connecting to the database.
**Connection Type** Whether to use an SID, Service Name, TNS Connect Descriptor, or TLS when connecting to the database.

**SID/Service Name/TNS Connect Descriptor:** Oracle connection point (Database name, Service name, or a TNS Connect Descriptor). When using TNS, place
the full TNS Connect Descriptor in the text field. For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@ private OracleConstants() {
public static final String ORACLE_CONNECTION_STRING_SID_FORMAT = "jdbc:oracle:thin:@%s:%s:%s";
public static final String ORACLE_CONNECTION_STRING_SERVICE_NAME_FORMAT = "jdbc:oracle:thin:@//%s:%s/%s";
public static final String ORACLE_CONNECTION_STRING_TNS_FORMAT = "jdbc:oracle:thin:@%s";
public static final String ORACLE_CONNECTION_STRING_TLS_FORMAT = "jdbc:oracle:thin:@tcps://%s:%s/%s";
public static final String DEFAULT_BATCH_VALUE = "defaultBatchValue";
public static final String DEFAULT_ROW_PREFETCH = "defaultRowPrefetch";
public static final String SERVICE_CONNECTION_TYPE = "service";
public static final String CONNECTION_TYPE = "connectionType";
public static final String ROLE = "role";
public static final String NAME_DATABASE = "database";
public static final String TNS_CONNECTION_TYPE = "TNS";
public static final String TLS_CONNECTION_TYPE = "TLS";
public static final String TRANSACTION_ISOLATION_LEVEL = "transactionIsolationLevel";

/**
* Returns the Connection String for the given ConnectionType.
*
* @param connectionType TNS/Service/SID
* @param connectionType TNS/Service/TLS/SID
* @param host Host name of the oracle server
* @param port Port of the oracle server
* @param database Database to connect to
Expand All @@ -59,6 +61,10 @@ public static String getConnectionString(String connectionType,
return String.format(OracleConstants.ORACLE_CONNECTION_STRING_SERVICE_NAME_FORMAT,
host, port, database);
}
if (OracleConstants.TLS_CONNECTION_TYPE.equalsIgnoreCase(connectionType)) {
return String.format(OracleConstants.ORACLE_CONNECTION_STRING_TLS_FORMAT,
host, port, database);
}
return String.format(OracleConstants.ORACLE_CONNECTION_STRING_SID_FORMAT,
host, port, database);
}
Expand Down
4 changes: 4 additions & 0 deletions oracle-plugin/widgets/Oracle-action.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
{
"id": "TNS",
"label": "TNS Connect Descriptor"
},
{
"id": "TLS",
"label": "TLS"
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions oracle-plugin/widgets/Oracle-batchsink.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
{
"id": "TNS",
"label": "TNS Connect Descriptor"
},
{
"id": "TLS",
"label": "TLS"
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions oracle-plugin/widgets/Oracle-batchsource.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
{
"id": "TNS",
"label": "TNS Connect Descriptor"
},
{
"id": "TLS",
"label": "TLS"
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions oracle-plugin/widgets/Oracle-connector.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
{
"id": "TNS",
"label": "TNS Connect Descriptor"
},
{
"id": "TLS",
"label": "TLS"
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions oracle-plugin/widgets/Oracle-postaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
{
"id": "TNS",
"label": "TNS Connect Descriptor"
},
{
"id": "TLS",
"label": "TLS"
}
]
}
Expand Down

0 comments on commit 6a28f9d

Please sign in to comment.