Commit 8ffaaa88 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #544 from facupanizza/master

ORACLE, (INSTANCE_NAME = XXXXX)
parents c61361d8 4f366bba
......@@ -193,6 +193,10 @@ pdo\_oci / oci8
connection pooling.
- ``charset`` (string): The charset used when connecting to the
database.
- ``instancename`` (string): Optional parameter, complete whether to
add the INSTANCE_NAME parameter in the connection. It is generally used
to connect to an Oracle RAC server to select the name of a particular instance.
pdo\_sqlsrv / sqlsrv
^^^^^^^^^^^^^^^^^^^^
......
......@@ -124,18 +124,23 @@ abstract class AbstractOracleDriver implements Driver, ExceptionConverterDriver
$service = 'SID=' . $serviceName;
$pooled = '';
$instance = '';
if (isset($params['service']) && $params['service'] == true) {
$service = 'SERVICE_NAME=' . $serviceName;
}
if (isset($params['instancename']) && ! empty($params['instancename'])) {
$instance = '(INSTANCE_NAME = ' . $params['instancename'] . ')';
}
if (isset($params['pooled']) && $params['pooled'] == true) {
$pooled = '(SERVER=POOLED)';
}
return '(DESCRIPTION=' .
'(ADDRESS=(PROTOCOL=TCP)(HOST=' . $params['host'] . ')(PORT=' . $params['port'] . '))' .
'(CONNECT_DATA=(' . $service . ')' . $pooled . '))';
'(CONNECT_DATA=(' . $service . ')' . $instance . $pooled . '))';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment