![]() | ![]() |
Home |
|
|
ASA Programming Interfaces Guide |
|
| Chapter 1: Programming Interface Overview |
Chapter 1
This chapter provides an introductory overview of each of the programming interfaces for Adaptive Server Anywhere. Any client application uses one of these interfaces to communicate with the database, and this chapter provides some guidelines to help you choose an appropriate interface for your application.
For an introduction to some aspects of database programming, see Using SQL in Applications .
ODBC (Open Database Connectivity) is a standard call level interface (CLI) developed by Microsoft. It is based on the SQL Access Group CLI specification. ODBC applications can run against any data source that provides an ODBC driver. You should use ODBC if you would like your application to be portable to other data sources that have ODBC drivers. Also, if you prefer working with an API, use ODBC.
ODBC is a low-level interface--about the same as Embedded SQL. Almost all the Adaptive Server Anywhere functionality is available with this interface. ODBC is available as a DLL under Windows NT, Windows 95, and Windows 3.x. It is provided as a library for UNIX.
The primary documentation for ODBC is the Microsoft ODBC Software Development Kit. The current book provides some additional notes specific to Adaptive Server Anywhere for ODBC developers.
ODBC is described in ODBC Programming
Embedded SQL is a system in which SQL commands are embedded right in a C or C++ source file. A preprocessor translates these statements into calls to a runtime library. Embedded SQL is an ISO/ANSI and IBM standard.
Embedded SQL is portable to other databases and other environments, and is functionally equivalent in all operating environments. It provides all of the functionality available in the product. Embedded SQL is quite easy to work with, although it takes a little getting used to the idea of Embedded SQL statements (rather than function calls) in C code.
Embedded SQL is described in The Embedded SQL Interface .
JDBC is a call-level interface for Java applications. Developed by Sun Microsystems, JDBC provides Java programmers with a uniform interface to a wide range of relational databases, and provides a common base on which higher level tools and interfaces can be built. JDBC is now a standard part of Java and is included in the JDK.
Sybase provides a JDBC driver, named Sybase jConnect. You can use jConnect to access Adaptive Server Anywhere databases. Sybase jConnect documentation is provided in Dynatext format.
In addition to using JDBC as a client side application programming interface, you can also use JDBC inside the database server to access data from Java in the database. For that reason JDBC is documented as part of the Java in the database documentation.
JDBC is not described in this book. For a description of JDBC, see Data Access Using JDBC
Sybase Open Client provides customer applications, third-party products, and other Sybase products with the interfaces needed to communicate with Adaptive Server Anywhere and other Open Servers.
You should consider using the Open Client interface if you are concerned with Adaptive Server Enterprise compatibility or if you are using other Sybase products that support the Open Client interface, such as Replication Server.
The Open Client interface is described in The Open Client Interface . Other information is presented in Adaptive Server Anywhere as an Open Server .
Open Client can be thought of as comprising two components: programming interfaces and network services.
Open Client provides two core programming interfaces for writing client applications: Client-Library and DB-Library.
Open Client DB-Library provides support for older Open Client applications, and is a completely separate programming interface from Client-Library. DB-Library is documented in the Open Client DB-Library/C Reference Manual, provided with the Sybase Open Client product.
Client-Library programs also depend on CS-Library, which provides routines that are used in both Client-Library and Server-Library applications. Client-Library applications can also use routines from Bulk-Library to facilitate high-speed data transfer.
Both CS-Library and Bulk-Library are included in the Sybase Open Client, available separately.
Open Client network services include Sybase Net-Library, which provides support for specific network protocols such as TCP/IP and DECnet. The Net-Library interface is invisible to application programmers. However, on some platforms an application may need a different Net-Library driver for different system network configurations. Depending on your host platform, the Net-Library driver is specified either by the system's Sybase configuration, or when you compile and link your programs.
Instructions for driver configuration can be found in the Open Client/Server Configuration Guide. Instructions for building Client-Library programs can be found in the Open Client/Server Programmer's Supplement.
|
|