SAP DB:ODBC Guide d'installation Page 108

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 225
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 107
mxODBC - Python ODBC Database Interface
5.10.1 One API for all Subpackages
To make applications portable between ODBC database backends, each of these
subpackages use the same names and API signatures, in fact, the same mxODBC
implementation is used for each of the subpackages, customized to meet the
respective ODBC driver/manager's specific requirements.
As an example, say if you are using the
mx.ODBC.Windows subpackage, then the
constructor to call would be
mx.ODBC.Windows.DriverConnect(). When
porting the application to Unix you'd use e.g. the
mx.ODBC.iODBC subpackage and
the constructor then becomes
mx.ODBC.iODBC.DriverConnect().
In your application you'd just have to change the top-level import from
from mx.ODBC import Windows as Database
to
from mx.ODBC import iODBC as Database
The subpackage globals such as exception names, helper functions, connection
constructors, etc. remain the same, so no additional changes are necessary.
Of course, you will usually have to rely on different ODBC drivers when switching
from Windows to Unix or the other way around. While the mxODBC API names
and signatures don't change, you will likely have to make some application level
changes to accommodate for differences in the ODBC drivers you are using.
86
Vue de la page 107
1 2 ... 103 104 105 106 107 108 109 110 111 112 113 ... 224 225

Commentaires sur ces manuels

Pas de commentaire