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
- Configuring Data Sources
- Testing Data Sources
- Troubleshooting Data Sources That Fail Verification
- Troubleshooting Data Sources by Database Type
(Troubleshoot your specific data source: DB2, Informix, Interbase, mySQL, Oracle, SQL Server, Sybase, SQL Anywhere)
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:
- Create a simple CFML template containing a
cfquerytag 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 thecfquerytag to see if the query works. - Put the file in your webroot.
- Browse the file from your web browser.
- 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:
- 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.
- 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.
- For JDBC connections, be sure the Driver Class and URL fields are entered correctly. Note that the information in these fields is case-sensitive.
- 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.
- 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=nobodytoCFUSER=rootand 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
- ColdFusion MX support for JDBC drivers not shipped with ColdFusion (18593)
- Diagnostic JAR file for data source connection issues (18355)
- ColdFusion MX: Modifying or using data sources generates errors (18299)
- ColdFusion MX: Error occurs when sorting by driver type in ColdFusion Administrator (18282)
- ColdFusion 5 (Solaris only): Updated Merant drivers (18188)
DB2
Informix
- ColdFusion 4.5.1 SP2: Using the new Informix 2.5 SDK Client Support (17812)
- Solaris: How to connect to Informix 7 and 9 (17134)
Interbase
mySQL
- ColdFusion 5 for Linux: Server crashes when using MyODBC driver to connect to a MySQL data source (18300)
- Troubleshooting MySQL data source connectivity on RedHat Linux (17903)
- ColdFusion 4.5.x: 'Unknown Connection' error when connecting to mySQL databases using myODBC for Solaris (17569)
- ColdFusion 5 (Professional): Microsoft SQL Server and mySQL data sources fail on ColdFusion 5 Professional on Linux Platform (17936)
Oracle
- ColdFusion MX: Oracle 9i Thin Client driver causes CPU to spike (18519)
- ColdFusion MX: Configuring the Oracle JDBC thin driver (18344)
- ColdFusion 5: Configuring Oracle 9i support (18320)
- ColdFusion 4.5.x and 5: The cfstoredproc tag does not support CLOB data type (18143)
- Diagnosing and resolving "Timeout while obtaining an Oracle connection lock" errors (18126)
- ColdFusion (Solaris): How to connect ColdFusion 4.x or 5 to an Oracle database (17218)
- ColdFusion (All versions): ORA-12154 error (17267)
PostgreSQL
SQL Server
- ColdFusion MX: Updating SQL Server 2000 unicode datatypes using JDBC drivers (18331)
- ColdFusion MX: Data source connections will fail to connect to multiple SQL Server 2000 and SQL 7.0 named instances (18294)
- ColdFusion 5 (Professional): Microsoft SQL Server and mySQL data sources fail on ColdFusion 5 Professional on Linux platform (17936)
Sybase
- ColdFusion MX: Configuring the Sybase jConnect 5.5 driver (18591)
- ColdFusion 4.5.x& 5: Incorrect configuration information in Sybase data sources causes errors (18186)
- Sybase OpenClient problems with Coldfusion 4.5.1 and RedHat Linux(17584)
Additional Information
Related TechNotes
This 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!
