Skip to content
Snippets Groups Projects
Unverified Commit 964d28b5 authored by Alessandro Vullo's avatar Alessandro Vullo Committed by GitHub
Browse files

Merge pull request #225 from james-monkeyshines/master

Oracle DB connections: if host is given, use it
parents 0c80deb1 03b158e0
No related branches found
No related tags found
No related merge requests found
......@@ -45,10 +45,18 @@ sub new {
sub connect_params {
my ($self, $conn) = @_;
my $host = $conn->host();
my $dbname = $conn->dbname();
my $dsn = "DBI:Oracle:";
my $username = sprintf("%s@%s", $conn->username(), $dbname );
my ($dsn, $username);
if (defined $host) {
my $port = $conn->port() || 1521;
$dsn = sprintf("DBI:Oracle://%s:%s/%s", $host, $port, $dbname);
$username = $conn->username();
} else {
$dsn = "DBI:Oracle:";
$username = sprintf("%s@%s", $conn->username(), $dbname );
}
return {
dsn => $dsn,
......
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