Skip to content

Commit

Permalink
make database (aka SID) optional for OCI connections
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11906 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 3, 2009
1 parent 6315e6e commit 8c91f1c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/app/ogr/qgsogrhelperfunctions.cpp
Expand Up @@ -56,10 +56,22 @@ QString createDatabaseURI( QString connectionType, QString host, QString databas
}
else if ( connectionType == "Oracle Spatial" )
{
uri = "OCI:" + user + "/" + password
+ "@" + host;
//MH 091102: connection to orcale does not seem to work with database name in uri
//+ "/" + database;
uri = "OCI:" + user;

if (( !user.isEmpty() && !password.isEmpty() ) ||
( user.isEmpty() && password.isEmpty() ) )
{
uri += "/";
if ( !password.isEmpty() )
uri += password;
}

if ( !host.isEmpty() )
{
uri += "@" + host;
if ( !database.isEmpty() )
uri += "/" + database;
}
}
else if ( connectionType == "ODBC" )
{
Expand Down

0 comments on commit 8c91f1c

Please sign in to comment.