Skip to main content
Participant
March 22, 2016
Question

Create DataSouce using API

  • March 22, 2016
  • 1 reply
  • 394 views

I want to create DataSource using ColdFusion Administrator API. All my credential are correct that's for sure. I have followed this tutorial and also Adobe Tutorial. I don't know what am doing wrong in here.

<cfset adminAPI = createObject( 'component', 'cfide.adminapi.administrator' ) />

<cfset adminAPI.login( 'CFAdminPass', 'admin' ) />

<cfscript>

  dsnAPI = createObject( 'component', 'cfide.adminapi.datasource' );

  dsn = {

  driver = 'mysql5',

  name = 'cfdb',

  host = 'localhost',

  port = '3306',

  database = 'cfdb',

  username = 'root',

  password = 'mysqlpass'

  };

  // Finally, we save the new datasource

  dsnAPI.setMySQL5( argumentCollection = dsn );

</cfscript>

This topic has been closed for replies.

1 reply

Inspiring
March 22, 2016

What is happening when you do this? Are you getting an error, have you  checked the logs?