Get a valid password from DatabaseConnectionProperties

563
3
05-08-2019 04:30 AM
TomGeo
by
Occasional Contributor III

I have sde files to connect to my Oracle database and as long as I use the Database class from ArcGIS.Core.Data the sde file is enough. However, I also need the credentials to issue some SQL commands later on.

The password property of DatabaseConnectionProperties returns the instance and the user name as it should, but the password property only returns an empty string.

Any suggestions on how to get the password read from the sde file?

ArcGIS.Core version 12.3.0.0, runtime version v4.0.30319

Thomas

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
3 Replies
RichRuh
Esri Regular Contributor

You cannot get a password from an SDE file.  This is by design.  It would be a security risk if you could, because that password could be used to gain access to additional resources beyond the single geodatabase resource.

0 Kudos
TomGeo
by
Occasional Contributor III

That sounds logic. However, if I do not read the API wrong: -> get and set???

I mean get would be enough for me.

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
RichRuh
Esri Regular Contributor

Thomas,

I'm not positive, but I believe that get only works on a newly created DatabaseConnectionProperties object, not one that has been created from a disk file.  I'll investigate and update the documentation in a future release.

--Rich