ColdFusion - java object method call

后端 未结 3 1691
甜味超标
甜味超标 2021-01-27 02:57

I\'m trying to get a list of datasources off my server (Yes I am the server owner...this is not a hack).

I think I confused the issue by giving two examples - so I\'m e

3条回答
  •  灰色年华
    2021-01-27 03:46

    For others who may happen upon this post, another way to do what was wanted, without needing to authenticate with the CF Admin password is to use the getNames() function of the DataSourceService instead of getDatasources. It returns an array of all the datasource names registered on the server.

    
        dbserv3 = createobject("java","coldfusion.server.ServiceFactory").getDataSourceService();
        dblist3 = dbserv3.getNames();
    
    

    This works on CF11

提交回复
热议问题