📄 manual.texi
字号:
calls. For more information about ODBC, see@uref{http://www.microsoft.com/data/}.@node What is ODBC, ODBC Standard, Introduction to ODBC, General Information@section What is ODBCMany misconceptions about ODBC exist in the computing world.To the end user, it is an icon in the Microsoft Windows Control Panel.To the application programmer, it is a library containing data accessroutines. To many others, it is the answer to all database accessproblems ever imagined.First and foremost, ODBC is a specification for a database API.This API is independent of any one DBMS or operating system;The ODBC API is language-independent.The ODBC API is based on the CLI specifications from X/Open and ISO/IEC.ODBC 3.x fully implements both of these specifications earlier versionsof ODBC were based on preliminary versions of these specifications butdid not fully implement them and adds features commonly needed bydevelopers of screen-based database applications, such as scrollablecursors.The developers of DBMS-specific drivers implement the functions in theODBC API.Applications call the functions in these drivers to access data in aDBMS-independent manner. A Driver Manager manages communication betweenapplications and drivers.@node ODBC Standard, ODBC Architecture, What is ODBC, General Information@section How Does ODBC Standardize Database AccessThere are two architectural requirements:@enumerate@itemApplications must be able to access multiple DBMSs using the samesource code without recompiling or re-linking.@itemApplications must be able to access multiple DBMSs simultaneously.@end enumerateODBC solves these problems in the following manner:@table @strong@item ODBC is a call-level interface:To solve the problem of how applications access multiple DBMSs usingthe same source code, ODBC defines a standard CLI. This contains allof the functions in the CLI specifications from X/Open and ISO/IECand provides additional functions commonly required by applications.@*@item ODBC defines a standard SQL grammar:In addition to a standard call-level interface, ODBC defines a standardSQL grammar. This grammar is based on the X/Open SQL CAE specification.If a statement uses ODBC grammar that is different from DBMS-specificgrammar, the driver converts it before sending it to the data source.However, such conversions are rare because most DBMSs already usestandard SQL grammar.@*@item ODBC provides a Driver Manager to manage simultaneous access to multiple DBMSs:Although the use of drivers solves the problem of accessing multiple DBMSssimultaneously, the code to do this can be complex. Applications that aredesigned to work with all drivers cannot be statically linked to any drivers.Instead, they must load drivers at run time and call the functions in themthrough a table of function pointers.The situation becomes more complex if the application uses multipledrivers simultaneously.Rather than forcing each application to do this, ODBC provides aDriver Manager.The Driver Manager implements all of the ODBC functions mostly as pass-throughcalls to ODBC functions in drivers and is statically linked to the applicationor loaded by the application at run time.Thus, the application calls ODBC functions by name in the Driver Manager,rather than by pointer in each driver.ODBC exposes a significant number of DBMS features, but does notrequire drivers to support all of them.@end table@node ODBC Architecture, Types of MySQL ODBC Drivers, ODBC Standard, General Information@section (My)ODBC ArchitectureThe MyODBC architecture has mainly 5 components as shown below:@* @image{Images/myarchitecture}@table @strong@item Application:An application is a program that calls the ODBC API to access thedata from (MySQL) server. The Application communicates with theDriver Manager or Driver directly using the standard ODBC calls.The Application does not care, where the data is stored, how itis stored or even how the system is configured to access the data.It only needs to know the Data Source Name (DSN).A number of tasks are common to all applications, no matter how they use ODBC.These tasks are:@itemize @bullet@item Selecting the (MySQL) server and connecting to it.@item Submitting an SQL statement for execution.@item Retrieving results (if any).@item Processing errors.@item Committing or rolling back the transaction enclosing the SQL statement.@item Disconnecting from the (MySQL) server.@end itemizeBecause most data access work is done with SQL, the primary task for whichapplications use ODBC is to submit SQL statements and retrieve the results (ifany) generated by those statements.@*@item Driver manager:The Driver Manager is a library that manages communicationbetween application and driver or drivers. It does:@itemize @bullet@item Resolves Data Source Names (DSN).@item Loading and unloading of the drivers.@item Processes ODBC function calls or passes them to the driver.@end itemize@*@item MyODBC Driver:MyODBC Driver is a library that implements the functions in theODBC API. It processes ODBC function calls, submits SQL requests to MySQLserver, and returns results back to the application. If necessary, the drivermodifies an application's request so that the request conforms to syntaxsupported by the MySQL.@*@item ODBC.INI:ODBC.INI is the ODBC configuration file, which stores the driver anddatabase information required to connect to the server. It is used bythe Driver Manager to determine which driver to be loaded using theData Source Name.Driver uses this to read connection parameters based on the DSN specified.For more information, @ref{Configuring MyODBC DSN}.@*@item MySQL SERVER:It is the source of data. MySQL is@itemize @bullet@item Data base management system (DBMS)@item Relational database management system (RDBMS)@item Open Source Software@end itemize@end table@node Types of MySQL ODBC Drivers, Where Can I Get MyODBC, ODBC Architecture, General Information@section Types of MySQL ODBC DriversAs described earlier, MySQL AB supports two Open Source ODBC drivers,namely MyODBC and MySQL ODBC 3.51 Driver, to access MySQL functionalitythrough the ODBC API.Note, from this section of the manual onwards, we refer both the driversas MyODBC itself, and whenever there is a difference then we keep theoriginal names.@node Where Can I Get MyODBC, How To Install MyODBC, Types of MySQL ODBC Drivers, General Information@section Where Can I Get MyODBCMySQL AB distributes all its products under General Public License (GPL).You can get the latest, free copy of MyODBC or MyODBC 3.51 driverbinaries and sources from its website @uref{http://www.mysql.com/}.For more information about MySQL ODBC Drivers, visit@uref{http://www.mysql.com/downloads/api-myodbc.html}.@node How To Install MyODBC, Supported Platforms, Where Can I Get MyODBC, General Information@section How To Install MyODBC@menu* Binary Windows Installation:: Binary Installation on Windows* Source Windows Installation:: Installing From Source Distribution on Windows* Source Installation Unix:: Installing From Source Distribution on Unix* Development Source Tree Installation:: Installing From The Development Source Tree@end menu@node Binary Windows Installation, Source Windows Installation, How To Install MyODBC, How To Install MyODBC@subsection Binary Installation on WindowsTo install MyODBC on Windows, you should download the appropriatedistribution file for your operating system from@uref{http://www.mysql.com/downloads/api-myodbc.html}, unpack it,and execute the @file{SETUP.EXE} file.@node Source Windows Installation, Source Installation Unix, Binary Windows Installation, How To Install MyODBC@subsection Installing From Source Distribution on Windows@subsubheading Requirements:@itemize @bullet@item@strong{MDAC}, Microsoft Data Access SDK from @uref{www.microsoft.com/data/}@item@strong{MySQL client libraries and include files} from 3.23.14 and above.This is required because MyODBC uses new calls that only exist starting from the above library, @uref{http://www.mysql.com/downloads/index.html}@end itemize@subsubheading Building MyODBC 3.51:@code{MyODBC 3.51} distributes its sources with @strong{Makefiles} that uses@file{nmake}. In the distribution, one can find @file{WIN_Makefile} for building therelease version and @file{WIN_Makefile_debug} for building the Debug version ofdriver libraries and DLLs. To build the driver:First, download and extract the sources to a folder @file{myodbc3-src},and follow the commands to build and install the release version
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -