Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy My Adobe
Date Date
Qty:
Subtotal
Promotions
Estimated Shipping
VAT
Calculated at checkout
Total
Checkout
ColdFusion Help / 

ColdFusion MX: Creating a pure Java connection to a data source

Adobe Community Help


Products Affected

  • ColdFusion

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

ColdFusion MX uses JDBC (Java Database Connectivity) as its native data source type. ColdFusion MX adds connection pooling and other enhancements to standard JDBC connections. At times it is useful to bypass these ColdFusion additions to test basic connectivity to a database.

The cfobject tag or the createobject function can be used to create a basic JDBC data source connection. This connection can verify if you are able to connect to a database outside of using standard ColdFusion data sources. It also provides a mechanism for creating result sets outside the standard ColdFusion query mechanism. These methods provide an alternative if standard methods fail or can be used as a troubleshooting step to gather information on a problematic database connection.

A JDBC connection usually requires two attributes, the JDBC URL and JDBC Classname. The format for these attributes is driver specific and supplied by the driver vendor. Check your driver documentation for this information if you are not using a Macromedia supplied driver. The following table gives URL and Classnames for the drivers shipped with ColdFusion MX.

Database Class and Driver information
MS SQL Server Class macromedia.jdbc.MacromediaDriver
Driver jdbc:macromedia:sqlserver://[host]: [port];databaseName=[database];SelectMethod= [selectmethod];sendStringParametersAsUnicode= [sendStringParametersAsUnicode]
Oracle (Macromedia) Class macromedia.jdbc.MacromediaDriver
Driver jdbc:macromedia:oracle://[host]:[port];SID= [sid];sendStringParametersAsUnicode= [sendStringParametersAsUnicode]
Oracle (Oracle 9.1 thin) Class oracle.jdbc.driver.OracleDriver
Driver jdbc:oracle:thin@[host]:[port]:[sid]:[args]
Sybase Class macromedia.jdbc.MacromediaDriver
Driver jdbc:macromedia:sybase://[host]:[port];DatabaseName= [database];SelectMethod= [selectmethod];sendStringParametersAsUnicode= [sendStringParametersAsUnicode]
MySQL Class org.gjt.mm.mysql.Driver
Driver jdbc:mysql://[host]:[port]/[database]?[args]
MS Access Class macromedia.jdbc.MacromediaDriver
Driver jdbc:sequelink:msaccess://[host]: [19998];serverDatasource=[datasource]
ODBC Socket Class macromedia.jdbc.MacromediaDriver
Driver jdbc:sequelink:odbcsocket://[host]: [19998];serverDatasource=[ODBC datasource]
Sun JDBC-ODBC Bridge Class sun.jdbc.odbc.JdbcOdbcDriver
Driver jdbc:odbc:[datasource];[UID=username]; [PWD=password];[args]

Insert the class name from this table into the Class.forName method in the CFML example provided. Insert the appropriate JDBC URL from the table into the Driver.getConnection method. If your connection or SQL statement fails, you will see a cfcatch structure dumped which should assist in troubleshooting. If the statement succeeds your will see your query object dumped. It is not recommended that you use cfdump on queries returning more than a few dozen rows given the resources used.

Download the jdbctest.zip file (3K). This file contains two sample templates, testJDBC.cfm and testJDBCTag.cfm. These templates have the same logic, but testJDBC.cfm does most of its work insidecfscript tags whereas testJDBCTag.cfm is mostly tag-based. Review the templates. To use the sample templates, update the data source attribute at the top of the file and then enter the proper JDBC class and URL for the driver you wish to use.

Keywords: tn_19607

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement