User Guide

108 The Database Connectivity API
The UltraDev 4 ColdFusion include file should be named MyConnection1.cfm, where
MyConnection1 is the name of your connection. The following example shows the include
file for a ColdFusion connection to a product table:
<!-- FileName="Connection_cf_dsn.htm" "dsn=products" -->
<!-- Type="ADO" -->
<!-- Catalog="" -->
<!-- Schema="" -->
<!-- HTTP="false" -->
<CFSET MM_MyConnection1_DSN = "products">
<CFSET MM_MyConnection1_USERNAME = "">
<CFSET MM_Product_USERNAME = "">
<CFSET MM_MyConnection1_PASSWORD = "">
The server behavior file includes this connection by using the cfinclude statement, as shown
in the following example:
<cfinclude template="Connections/MyConnection1.cfm">
JSP
The JSP include file should be named MyConnection1.jsp, where MyConnection1 is the
name of your connection. The following example is the include file for a JDBC connection to
a database:
<%
// Filename="Connection_jdbc_conn1.htm"
// Type="JDBC"
// HTTP="false"
// Catalog=""
// Schema=""
String MM_MyConnection1_DRIVER = "com.inet.tds.TdsDriver";
String MM_MyConnection1_USERNAME = "testadmin";
String MM_MyConnection1_PASSWORD = "velcro";
String MM_MyConnection1_URL = "jdbc:server:test-
3:1433?database=pubs";
%>
The server behavior file includes this connection by using the relative file include statement,
as shown in the following example:
<%@ include file="Connections/MyConnection1.jsp" %>
000_DW_API_Print.book Page 108 Wednesday, July 20, 2005 11:58 AM