MACROMEDIA COLFUSION MX 7 - CONFIGURING AND ADMINISTERING COLDFUSION MX Manual page 40

Hide thumbs Also See for COLFUSION MX 7 - CONFIGURING AND ADMINISTERING COLDFUSION MX:
Table of Contents

Advertisement

To use the Administrator API:
Instantiate administrator.cfc:
1.
<cfscript>
// Login is always required.
adminObj = createObject("component","cfide.adminapi.administrator");
Tip: You can instantiate administrator.cfc and call the
following example shows:
createObject("component","cfide.adminapi.administrator").login("admin");
Call the administrator.cfc
2.
or the RDS password:
adminObj.login("admin");
Instantiate the desired CFC:
3.
myObj = createObject("component","cfide.adminapi.debugging");
Call the desired CFC method (this example enables debugging):
4.
myObj.setDebugProperty(propertyName="enableDebug", propertyValue="true");
Examples
The following example adds a SQL Server data source:
<cfscript>
// Login is always required. This example uses two lines of code.
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
// Instantiate the data source object.
myObj = createObject("component","cfide.adminapi.datasource");
// Create a DSN.
myObj.setMSSQL(driver="MSSQLServer",
name="northwind_MSSQL",
host = "10.1.147.73",
port = "1433",
database = "northwind",
username = "sa",
login_timeout = "29",
timeout = "23",
interval = 6,
buffer = "64000",
blob_buffer = "64000",
setStringParameterAsUnicode = "false",
description = "Northwind SQL Server",
pooling = true,
maxpooledstatements = 999,
enableMaxConnections = "true",
maxConnections = "299",
enable_clob = true,
enable_blob = true,
disable = false,
40
Chapter 2: Using the ColdFusion MX Administrator
method, passing the ColdFusion MX Administrator password
login
method in a single line of code, as the
login

Advertisement

Table of Contents
loading

Table of Contents