FreeTDS User Guide: A Guide to Installing, Configuring and Running FreeTDS | ||
---|---|---|
Prev | Chapter 1. What is FreeTDS? | Next |
FreeTDS consists of two projects. The FreeTDS C libraries and FreeTDS/ JDBC.
The FreeTDS C libraries support three separate APIs: db-lib, ct-lib, and ODBC. Underlying these three is libtds which handles the low-level details of the TDS protocol, such as sending, receiving, and datatype conversion.
The FreeTDS/JDBC, developed by Craig Spannring, is a free, native 100% Java implementation of a Type 4 JDBC driver. Currently it has only been tested mostly on SQL Server 6.5 and 7.0. The driver is not complete, but Methods that aren't implemented will throw a SQLException with the message "Not implemented". This project has recently gotten a second wind as the jTDS project on SourceForge .
As of version 0.60, the db-lib and ct-lib APIs are fairly stable. They have been successfully substituted for Sybase's own libraries in a variety of venues, including Perl and PHP. That is not to say that these drivers are complete; they're not. But they faithfully implement an important subset of their APIs, enough to be useful.
In addition to the core db-lib API, FreeTDS includes a full implementation of db-lib's bcp functions, as well as freebcp, a replacement for Sybase's bcp utility.
The ODBC driver is slightly weaker but may be usable depending on your application's needs. It is under active development. Any problems found in the currently implemented API subset are cheerfully addressed. The FreeTDS 0.60 ODBC driver was a vast improvement over earlier versions, and with 0.61 it began to comply with the ODBC 3.0 specification.
Basic API coverage information is available at www.freetds.org (that file is also shipped with the source distribution). Detailed information about the extent of the API coverage is being prepared.
You may be wondering how these libraries fit with Perl, PHP, TCL, Python, or other popular scripting languages. Most of these languages have bindings to Sybase that use either the db-lib or ct-lib APIs, for which FreeTDS is intended as a drop-in replacement. For instance, Michael Peppler's DBD::Sybase works very well using FreeTDS to access Sybase or Microsoft SQL Servers. PHP has options for sybase (db-lib) and sybase-ct (ct-lib) APIs.
FreeTDS is a source code library, though, not a binary one. It has to be linked to a program. For it to be useful to you in any way, you have to be prepared to break out your build tools.
Should FreeTDS not suit your needs, some alternatives
In the time since FreeTDS was started, Sybase (as well as most major DBMS vendors) has released its database for the Intel GNU/Linux platform. The good: it is a solid product and supports TDS 4.2 and TDS 5.0. The bad: it doesn't support TDS 7.0 or Linux/*BSD on non-Intel platforms. The ugly: Microsoft broke date handling for big endian Sybase clients.
Depending on platform, it may cost something.
They use the ODBC driver on the NT box where your SQL Server runs so you'll never have trouble with new protocols and the like. On the downside, they can be costly and may be inefficient. We know of EasySoft ODBC-ODBC Bridge from EasySoft, Universal Data Access Driver from OpenLink Software, SequeLink from Merant, and ODBC Router from August Software Corporation.
Based on libtds, this is a native ODBC driver for i386 *nix. It is free in price, but comes only as a binary at the present time.
We have no direct experience with this Perl-only option. It has the same caveats as an ODBC bridge except it's free.