The ColdFusion MX 7 Admin API can be used to create new datasources or modify existing ones in a supported, programmatic manner. Its useful to verify the datasource once created or modified, however the Admin API does not provide the error detail should verification fail, rather it only provides a boolean true or false result.

To obtain error details for failed datasource verification for a datasource created or modified through the Admin API, the ServiceFactory's DataSourceFactory can be invoked to call its verifiyDatasource() method instead. While this is not an optimal solution since the ServiceFactory methods remains unsupported, the Admin API is essentially a supported wrapper for the ServiceFactory anyway and much has been written about using ServiceFactory to manipulate ColdFusion server configuration. Here, the use of ServiceFactory is read-only, and is not used to make changes, but simply to verify a datasource to get to the error.

One bug to watch out for is that the timeout value for a new datasource is set in seconds, although when browsing the generated CFC metadata for the Admin API the timeout is described incorrectly as minutes.