Here is some code I wrote quite a while ago to list the available datasources on the server. More than likely it is some code I found somewhere else as I doubt I was anywhere near the first person to do this.

However, I figure it might be useful to someone else so here goes:

<CFLOCK Name="ServiceFactory" Type="Exclusive" TimeOut="10">
<CFSET Factory = CreateObject("java",
<CFSET Service = Factory.getDataSourceService()>
<CFSET DataSources = Service.DataSources>
<CFSET Datasources = StructKeyArray(Datasources)>
<CFSET Temp = ArraySort(Datasources, "textnocase", "asc")>

<select name="datasource">
<CFLOOP From="1" To="#ArrayLen(Datasources)#" Index="i">
<option value="#Datasources[i]#">#Datasources[i]#</option>


Mohsin Raza

Thanks. This was very helpful in sorting out a hosting related problem.