Get a valid password from DatabaseConnectionProperties

183
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

-------------------------
“GIS is a form of digital mapping technology. Kind of like Google Earth, but better.” ~ Arnold Schwarzenegger
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.

-------------------------
“GIS is a form of digital mapping technology. Kind of like Google Earth, but better.” ~ Arnold Schwarzenegger
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