# Connecting to Sybase System 11 data sources

Connections to Sybase System 11 databases are supported on both Windows and UNIX operating systems. On Windows, ColdFusion uses native drivers and on UNIX, ColdFusion uses both native and ODBC drivers to connect to Informix databases. ColdFusion 4.5 supports Informix 7.3 and higher.

## Configuring Sybase System 11 Options (Windows)

If ColdFusion Server Enterprise edition is installed on a Windows NT server, you can configure Sybase System 11 ColdFusion data sources using a native driver.

| Native Driver: Sybase System 11 (Windows)

To connect to Sybase System 11 databases on both Windows and UNIX, you must first install the Sybase client software, Sybase Open Client version 11.1.0 with Update 11.1.1 applied. Follow these steps to use the native driver:

1. Install the Sybase Open Client version 11.1.0 (with Update 11.1.1 applied) client software.
2. Verify the connection to the database using a tool like Sybase SQL Advantage.
3. Create the data source in the ColdFusion Administrator, Native Drivers page.

The following table describes ColdFusion options for the Sybase System 11 and Sybase Adaptive Server 11.5 data sources. You set these options when you configure a ColdFusion data source. See "Adding Data Sources for ColdFusion" for more information about adding data sources to ColdFusion.

Sybase System 11/Adaptive Server 11.5 Native Database Driver Options
Option | Description
--- | ---
Data Source Name | A name for your ODBC data source.
Description | Descriptive information about the data source.
Server | Enter the name of the server hosting the Sybase System 11 database.
Default Database | Enter the name of the default database to use on the specified server.

## Configuring Sybase System 11 Options (UNIX)

If ColdFusion Server Enterprise edition is installed on a UNIX server, you can configure Sybase System 11 ColdFusion data sources using either native or ODBC drivers.

| Native Driver: Sybase System 11 (UNIX)

ColdFusion native drivers are the same for both Windows NT and UNIX. To see ColdFusion options for the Sybase System 11 native driver, see the table in "Native Driver: Sybase System 11 (Windows)".

| ODBC: Sybase System 11 (UNIX)

The following table describes ColdFusion options for the MERANT Sybase System 11 ODBC driver. You set these options when you configure a ColdFusion data source. See "Adding Data Sources for ColdFusion" for more information about adding data sources to ColdFusion.

MERANT Sybase System 11 ODBC Options
Option | Description
--- | ---
Data Source Name | A name for your ODBC data source.
Description | Descriptive information about the data source.
Database Name | The name of the database to which you want to connect.
Server Name | The name of the server containing the Sybase tables you want to access. If not supplied, the initial default is the server name in the DSQUERY environment variable. On UNIX, the name of a server from your $SYBASE/interfaces file.
Workstation ID | The workstation ID used by the client.
Performance | Row Limit -- The number of rows the driver retrieves from the server for a fetch. Enabling this option can increase performance by reducing network traffic.
Create stored procedures -- This option determines whether stored procedures are created on the server for every call to SQLPrepare. When enabled, stored procedures are created for every call to SQLPrepare. This setting can result in bad performance when processing static statements. When disabled, the driver does not create stored procedures.
Disable database cursors for Select statements -- Determines whether database cursors are used for Select statements. In some cases performance degradation can occur when performing large numbers of sequential Select statements because of the amount of overhead associated with creating database cursors.
Customization | Enable Password Encryption from Open Client Library to Server -- Determines whether password encryption can be performed from the Open Client Library to the server.

## Tips for Connecting to Sybase System 11 (UNIX)

Keep the following in mind when you create Sybase ColdFusion data sources:

- You can set up the Sybase data source using the ColdFusion Administrator Data sources page.
- You will need Sybase Open Client version 11.1.0 with Update 11.1.1 applied on your server. This software does not ship with ColdFusion.
- Check that the SYBASE environment variable is set up in the `/opt/coldfusion/start` script. Also check that the LD_LIBRARY_PATH has the $SYBASE/lib directory in the beginning of its path. See "The /opt/coldfusion/bin/start script" for an example.
- Set up an entry in the interfaces file for the particular database you want to connect to. The interfaces file is in the $SYBASE directory, for example, `/opt/sybase` or `/work/sybase` or wherever the Sybase client software was installed. You can use a Sybase utility called `sybinit` on UNIX to update this file.

Note | If the Sybase database is on the same server as ColdFusion make sure the $SYBASE environment variable that you set up in the ColdFusion start script is pointing to the Sybase client directory and not the Sybase server directory. Both of these directories contain an interfaces file.

When you've completed all the steps in this section, you will need to stop and restart ColdFusion services to reload the `odbc.ini` file.

### The /opt/coldfusion/bin/start script

    #!/bin/sh
    # start - setup environment and run Cold Fusion servers
    # This script should be run as root.
    # Run as root, we are able to start the system registry deamon
    # and then change to the Cold Fusion userid to start the servers
    # Set during install

    CFHOME=/opt/coldfusion
    CFUSER=nobody

    # Sybase Open Client directory

    SYBASE=/work/sybclient11.1;export SYBASE

    #II_SYSTEM=/home
    # Set library search path
    # NOTE: Add your database client library directory to the FRONT
    # of this list
    # Example:
    # LD_LIBRARY_PATH=$SYBASE/lib:/usr/dt/lib:/lib:/usr/openwin/lib:
    # $CFHOME/lib

    LD_LIBRARY_PATH=$SYBASE/lib:/usr/dt/lib:/lib:/usr/openwin/lib:$CFHOME/
    lib

    # This is the list of variables that Cold Fusion will see
    # Add any special Database environment varaibles here

    VAR_LIST=""LD_LIBRARY_PATH CFHOME SYBASE ORACLE_HOME INFORMIXDIR
    INFORMIXSERVER II_SYSTEM""