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()#">
<CFOBJECT ACTION="CREATE" TYPE="JAVA" CLASS="coldfusion.server.ServiceFactory" NAME="factory">
<!--- Get datasource service --->
<CFSET dsService=factory.getDataSourceService()>
<cfdump var="#dsService.getNames()#">
<< Home