Skip to main content
Solved

Pythoncaller: how check if a oracle database connection is available

  • Apr 21, 2026 2:48 PM UTC
  • 1 reply
  • 89 views

joy
Enthusiast
Forum|alt.badge.img+15

Hello everyone,
I was wondering if it's possible in the Pythoncaller to check based on an user parameter (for example “database”) whether the database is avaibable in the user's database connections (FME Options > Database connections). I was looking at Connections — Python FME API FME 2026.1 b26103 documentation, but I don't really get wiser which functions to use.

Best answer by david_r

Sure, do something like this:

import fmewebservices

connection_name = "My database connection name"
ncm = fmewebservices.FMENamedConnectionManager()
fme_conn = ncm.getNamedConnection(connection_name)

if fme_conn is None:
raise Exception(f"Connection '{connection_name}' not found")

connection_params = fme_conn.getNameValues()
print("User name:", connection_params.get("USER_NAME"))
print("Server:", connection_params.get("SERVER"))

Up until line 9 will work for both database and web connections, thereafter it depends on the type of connection that was returned.

Notes:

  • connection_name is case sensitive
  • the resulting connection_params dict contents may differ depending on the connection type
View original
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

david_r
Celebrity
  • Best Answer
  • Apr 21, 2026 3:43 PM UTC

Sure, do something like this:

import fmewebservices

connection_name = "My database connection name"
ncm = fmewebservices.FMENamedConnectionManager()
fme_conn = ncm.getNamedConnection(connection_name)

if fme_conn is None:
raise Exception(f"Connection '{connection_name}' not found")

connection_params = fme_conn.getNameValues()
print("User name:", connection_params.get("USER_NAME"))
print("Server:", connection_params.get("SERVER"))

Up until line 9 will work for both database and web connections, thereafter it depends on the type of connection that was returned.

Notes:

  • connection_name is case sensitive
  • the resulting connection_params dict contents may differ depending on the connection type