![MACROMEDIA COLFUSION MX 7 - INSTALLING AND USING COLDFUSION... Manual Download Page 40](http://html1.mh-extra.com/html/macromedia/colfusion-mx-7-installing-and-using-coldfusion/colfusion-mx-7-installing-and-using-coldfusion_manual_3307073040.webp)
40
Chapter 2: Using the ColdFusion MX Administrator
To use the Administrator API:
1.
Instantiate administrator.cfc:
<cfscript>
// Login is always required.
adminObj = createObject("component","cfide.adminapi.administrator");
Tip:
You can instantiate administrator.cfc and call the
login
method in a single line of code, as the
following example shows:
createObject("component","cfide.adminapi.administrator").login("admin");
2.
Call the administrator.cfc
login
method, passing the ColdFusion MX Administrator password
or the RDS password:
adminObj.login("admin");
3.
Instantiate the desired CFC:
myObj = createObject("component","cfide.adminapi.debugging");
4.
Call the desired CFC method (this example enables debugging):
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,
Summary of Contents for COLFUSION MX 7 - INSTALLING AND USING COLDFUSION...
Page 1: ...COLDFUSION MX7 Configuring and Administering ColdFusion MX ...
Page 6: ...6 Contents ...
Page 10: ......
Page 78: ...78 Chapter 4 Web Server Management ...
Page 84: ...84 Chapter 5 Deploying ColdFusion Applications ...
Page 102: ...102 Chapter 7 Using Multiple Server Instances ...
Page 104: ......
Page 108: ...108 Chapter 8 Introducing Verity and Verity Tools ...