Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create DataSouce using API

New Here ,
Mar 21, 2016 Mar 21, 2016

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>

350
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 22, 2016 Mar 22, 2016
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources