// This will dump all of the services in CFMX <cfobject
type="JAVA" action="Create" name="factory"
class="coldfusion.server.ServiceFactory"> <CFdump var="#factory#">
// This will dump the datasources and drivers manipulating datasources
is as simple as modifying
// the structure datasources below
<cfobject type="JAVA" action="Create" name="factory"
class="coldfusion.server.ServiceFactory">
<cfset sqlexecutive = factory.getDataSourceService()>
<cfset drivers=sqlexecutive.drivers>
<cfset datasources=sqlexecutive.datasources>
<cfdump var="#sqlexecutive#" label="DataSource Factory">
<cfdump var="#datasources#" label="DataSources">
<cfdump var="#drivers#" label="Database Drivers">
//All DSN information in CFMX is available as a structure so you
can display the information easily:
<cfobject type="JAVA" action="Create" name="factory"
class="coldfusion.server.ServiceFactory">
<cfset sqlexecutive = factory.getDataSourceService()>
<cfset datasources=sqlexecutive.datasources>
// now if you want to see the information on all datasources you can
dump it:
<cfdump var="#datasources#" label="DataSources">
//If you wanted to see just a specific datasource
<cfdump var="#datasources.dsname#" label="DataSources">
//or if you only wanted to see the JDBC URL
<cfoutput>#datasources.tacwebdb.url#</cfoutput>
//If you are not sure of a specific URL for a driver you can dump
out all of the drivers with example URL's as well
<cfobject type="JAVA" action="Create" name="factory"
class="coldfusion.server.ServiceFactory">
<cfset sqlexecutive = factory.getDataSourceService()>
<cfset drivers=sqlexecutive.drivers>
<cfdump var="#drivers#" label="Database Drivers">
|