Everything Java Apache Geospatial Open Source. Hello Shinning Stars!!! Vincent Massol, Raphael Luta, Santiago Gala, Carsten Z.

Tuesday, December 12, 2006

Linux ODBC

When you get the following command to work you've got Linux ODBC working but getting there is not always easy. I'm using Debian 3.1 other distros may vary.

isql -v myDatasource

The argument myDatasource is the name defined in /etc/odbc.ini

postgres@debian:~$ cat /etc/odbc.ini
Description = Rose
Driver = PostgreSQL
Trace = Yes
TraceFile = /tmp/psqlodbc.log
Database = rose
Servername = localhost
UserName = postgres
Password = myPassword
Port = 5432
Protocol = 6.4
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
ConnSettings =

Notice the username is the default postgres account. The Driver and Database are also key values.

The Driver is defined in /etc/odbcinst.ini

postgres@debian:~$ cat /etc/odbcinst.ini
Description = PostgreSQL ODBC driver
Driver = /usr/lib/odbc/psqlodbc.so
Setup = /usr/lib/odbc/libodbcpsqlS.so
Debug = 1
CommLog = 1
FileUsage = 1

No comments: