Accessibility

TechNote (Archived)

Troubleshooting data sources and database connectivity for Unix platforms

If you are having trouble connecting to and verifying a data source in Macromedia ColdFusion Server on a Unix platform (Solaris, HP-UX, and Linux), this guide may give you some tips on how to troubleshoot your connectivity problems.

Table of Contents
Connecting To Your Database

ColdFusion Server can communicate with virtually any database through ODBC, Native and JDBC database drivers.

ODBC

  • Available in all versions of ColdFusion Server.
  • ColdFusion Server can communicate with databases that have an ODBC 3.0 compliant driver.
  • ColdFusion for Solaris uses Merant's ODBC Drivers for several well-known databases (dBASE, FoxPro, DB2, Informix, Sybase, OpenIngres, Oracle, Text). Macromedia does not make ODBC drivers. Supported database driver versions vary by ColdFusion Server version. Refer to the documentation for your ColdFusion Server to see what database driver versions are supported.
  • Please contact your database vendor for ODBC drivers. There are also several 3rd party vendors who make ODBC database drivers, including Merant, OpenLink Software and ATI.

Native

  • Available through version 5 of ColdFusion Server.
  • ColdFusion Server for Solaris can communicate with Sybase, Oracle, Informix and DB2 using Native Drivers. Supported database driver versions vary by ColdFusion Server version. Refer to the documentation for your ColdFusion Server to see what database driver versions are supported.

JDBC

  • Available in ColdFusion MX.
  • ColdFusion Server can communicate with databases that have a JDBC 2.0 compliant driver.
  • ColdFusion for Unix platforms uses DataDirect's JDBC Drivers for several well-known databases (DB2, Informix, Sybase, Oracle). Macromedia does not make JDBC drivers. Supported database driver versions vary by ColdFusion Server version. Refer to the documentation for your ColdFusion Server to see what database driver versions are supported.
  • Please contact your database vendor for JDBC drivers. There are also several 3rd party vendors who make JDBC database drivers. A searchable listing is available at industry.java.sun.com/products/jdbc/drivers.
Configuring Data Sources

The steps for configuring data sources vary by version of ColdFusion and type of driver and database being used. Refer to the documentation for your ColdFusion Server to see the steps for your particular configuration.

Testing your Database Connection

To test your database connection, use the following steps:

  1. Create a simple CFML template containing a cfquery tag that queries your data source.

    For instance, if you set up a data source in your ColdFusion Administrator called testdatasource, which contains a table called testtable, you could create a simple CFML file with the following lines:
     <cfquery name="testquery"  datasource="testdatasource">  Select *       from testtable</cfquery> 

    You may also want to try embedding the username and password attributes into the cfquery tag to see if the query works.
  2. Put the file in your webroot.
  3. Browse the file from your web browser.
  4. If the query fails, use the steps and related TechNotes in this document to troubleshoot the problem.
Troubleshooting Data Sources That Fail Verification

Under certain conditions, an otherwise valid data source connection can fail to verify in ColdFusion Administrator or produce an error message. Use the steps below to ensure the information you have entered for your data source is correct to successfully verify a data source:

  1. Ensure that you have properly set up the data source connection inside of ColdFusion Administrator. Check the following for your database:
    • Check that the Server Name/Host String or path to the database file(s) is correct.
    • Check that the username and password is correct. In the ColdFusion Administrator Data Sources area, click CF Settings on the detail page for your data source. Check the username and password for your data source.
  2. If using ODBC or JDBC, update your drivers. It is recommended that you use the driver provided by your database vendor. After updating ODBC drivers, reboot your machine and recheck your data source definitions.
  3. For JDBC connections, be sure the Driver Class and URL fields are entered correctly. Note that the information in these fields is case-sensitive.
  4. Ensure that the path to your database client software is properly defined and included in your LD_LIBRARY_PATH in the /opt/coldfusion/bin/start script.
  5. Changing the account that the ColdFusion Server services run under from the nobody account (the default) to root. To do this, edit the /opt/coldfusion/bin/start script and changing the line that says CFUSER=nobody to CFUSER=root and restart the services.

    If changing the account ColdFusion runs under fixes the problem, it means that you have some sort of permissions issue on your Unix box that needs to be resolved. Additionally, ensure the following items:
    • Check that the nobody user has a valid shell assigned to it.
    • Check that the nobody user has access to the directories containing ColdFusion, as well as the directories where your database client software is installed.
Troubleshooting Data Sources by Database Type

Non-Database Specific TechNotes

DB2

Informix

Interbase

mySQL

Oracle

PostgreSQL

SQL Server

Sybase

Additional Information


Related TechNotes


AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_17262
Browser:Chrome
Internet Explorer
Netscape
Opera
Safari
Firefox
Database:DB2
Informix
MySQL
Oracle
SQL Server
Sybase
MS Access

Products Affected: