This TechNote describes how to configure ColdFusion MX to use the Microsoft SQL Server 2005 JDBC Driver to connect to a Microsoft SQL Server 2005 database. This driver is distributed by Microsoft and is available at no charge in localized versions for Windows and Linux/Unix.

Configuring ColdFusion MX to use the Microsoft SQL Server 2005 JDBC Driver

  1. Download the driver from Microsoft.

  2. Install the driver. The default Windows installation location is C:\Program Files\Microsoft SQL Server 2005 Driver for JDBC.
  3. Add the sqljdbc.jar to the Java classpath:
    • For Server and Multiserver configurations:
      1. Access the ColdFusion Administrator "Java and JVM" page.
      2. Add the full path to the sqljdbc.jar to the Class Path field. For example, the default on Windows is C:\Program Files\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_1.0\enu\sqljdbc.jar on Windows platforms.
      3. Click Submit Changes to update Java and JVM Settings for ColdFusion MX.
      4. Restart the ColdFusion MX Application Server service. Note: On Linux/Unix platforms, from the cf_root/runtime/bin directory, run coldfusion restart.
    • For J2EE configurations, consult your server's documentation for properly adding the sqljdbc.jar to the classpath.
  4. Use the ColdFusion Administrator Data Sources page to add a new data source for the Microsoft JDBC driver:

    For example:
    1. Name the data source ps_db where it will connect to the server named ps-db where MicrosoftSQL Server resides.
    2. Select Other in the driver field to tell ColdFusion you will describe another type of driver.
    3. Click Add to add the data source and display the default driver window for this driver.
  5. Enter the following in the JDBC URL field:

    jdbc:sqlserver:// ps-db : 1433 ;DatabaseName= NorthWind

    Where ps-db is the name of the database server.

    Where 1433 is the port number for the data source connection.

    Where NorthWind is the database you are connecting to.

    Note: The information in this field is case-sensitive.
  6. Enter the following in the Driver Class field:

    Note: The information in this field is case-sensitive.
  7. Enter a valid username and password in the Username and Password fields.

    Where the username and password are defined as user account information on the database server.
  8. (Optional) Enter the name of the driver in the Driver Name field.
  9. Click Submit to apply the changes to the data source.

Additional Information

  • ColdFusion MX: Configuring the Microsoft SQL Server 2000 JDBC driver
  • ColdFusion MX: Trailing space in Driver Class field causes data source verification failure (18612)
  • ColdFusion MX: Configuring the Sybase jConnect 5.5 driver (18591)
  • ColdFusion MX: Enabling a JDBC data source for PostgreSQL (18338)
  • ColdFusion MX: Configuring the Oracle JDBC thin driver (18344)

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