Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| utilisateurs:grigouille:brouillons:unixodbc [Le 09/06/2019, 15:58] – créée grigouille | utilisateurs:grigouille:brouillons:unixodbc [Le 09/06/2019, 16:43] (Version actuelle) – grigouille | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | {{tag> | ||
| ---- | ---- | ||
| - | {{ :applications: | + | {{http:// |
| ====== unixODBC ====== | ====== unixODBC ====== | ||
| - | + | ||
| - | [[https:// | + | [[wp>UnixODBC]] est une implémentation libre de l'API [[wpfr>Open_Database_Connectivity|ODBC]]. |
| Ligne 10: | Ligne 9: | ||
| ===== Installation ===== | ===== Installation ===== | ||
| - | Pour installer ce logiciel, il suffit d' | + | Pour installer ce logiciel, il suffit d' |
| + | <code bash>$ odbcinst -j | ||
| + | unixODBC 2.3.4 | ||
| + | DRIVERS............: | ||
| + | SYSTEM DATA SOURCES: / | ||
| + | FILE DATA SOURCES..: / | ||
| + | USER DATA SOURCES..: / | ||
| + | SQLULEN Size.......: | ||
| + | SQLLEN Size........: | ||
| + | SQLSETPOSIROW Size.: 8 | ||
| + | </ | ||
| ===== Configuration ===== | ===== Configuration ===== | ||
| + | ====SQLite3==== | ||
| + | [[: | ||
| + | <code bash> | ||
| + | $ cat / | ||
| + | [SQLite] | ||
| + | Description=SQLite ODBC Driver | ||
| + | Driver=libsqliteodbc.so | ||
| + | Setup=libsqliteodbc.so | ||
| + | UsageCount=1 | ||
| + | |||
| + | [SQLite3] | ||
| + | Description=SQLite3 ODBC Driver | ||
| + | Driver=libsqlite3odbc.so | ||
| + | Setup=libsqlite3odbc.so | ||
| + | UsageCount=1 | ||
| + | |||
| + | $ | ||
| + | </ | ||
| + | |||
| + | Vérification <code bash> | ||
| + | $ odbcinst -q -d | grep SQLite | ||
| + | [SQLite] | ||
| + | [SQLite3] | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | Pour tester, il faut configurer le fichier odbc.ini : | ||
| + | <code bash> | ||
| + | $ cat ~/ | ||
| + | [test] | ||
| + | Driver=SQLite3 | ||
| + | Database=/ | ||
| + | </ | ||
| + | Remplacer Database par le chemin vers votre base SQLite3 (ou un fichier vide). | ||
| + | |||
| + | Tester : | ||
| + | < | ||
| + | $ isql test | ||
| + | +---------------------------------------+ | ||
| + | | Connected! | ||
| + | | | | ||
| + | | sql-statement | ||
| + | | help [tablename] | ||
| + | | quit | | ||
| + | | | | ||
| + | +---------------------------------------+ | ||
| + | SQL> create table aTable(id int); | ||
| + | SQLRowCount returns 0 | ||
| + | SQL> insert into aTable values(10); | ||
| + | SQLRowCount returns 1 | ||
| + | SQL> select * from aTable; | ||
| + | +-----------+ | ||
| + | | id | | ||
| + | +-----------+ | ||
| + | | 10 | | ||
| + | +-----------+ | ||
| + | SQLRowCount returns 0 | ||
| + | 1 rows fetched | ||
| + | SQL> | ||
| + | </ | ||
| + | |||
| + | |||
| - | Tout d' | + | |
| - | + | ||
| - | ===== Utilisation ===== | + | |
| - | + | ||
| - | Lancez l' | + | |
| - | + | ||
| ===== Désinstallation ===== | ===== Désinstallation ===== | ||
| Ligne 28: | Ligne 95: | ||
| * **(en)** [[http:// | * **(en)** [[http:// | ||
| - | | + | |
| - | * [[http:// | + | |
| ---- | ---- | ||
| - | // | + | // |
| - | //Basé sur [[http://www.document_source.com|« Titre original de l' | + | //Basé sur [[https://blog.sleeplessbeastie.eu/ |
