Skip to main content
Solved

Pythoncaller: how check if a oracle database connection is available

  • April 21, 2026
  • 1 reply
  • 41 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

1 reply

david_r
Celebrity
  • Best Answer
  • April 21, 2026

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