Musings of a Manchester Drupal guy

Drupal, Open Source, Analytics, Social Media.

Wednesday, June 29, 2005

Programmatically list datasources using ServiceFactory

This code snippet allows you to list all the datasources on your server

<!--- Get "factory" --->
<CFOBJECT ACTION="CREATE" TYPE="JAVA" CLASS="coldfusion.server.ServiceFactory" NAME="factory">
<!--- Get datasource service --->
<CFSET dsService=factory.getDataSourceService()>

<cfdump var="#dsService.getNames()#">