[ILUG-BOM] ODBC version on Linux

Binand Sethumadhavan binand at gmail.com
Mon Dec 27 22:16:32 IST 2010

2010/12/27 Roshan <kubunturos at gmail.com>:
> So, to elaborate further Oracle 10g is installed on RHEL 5.4 and this
> machine acts as a database server. An application (J2EE) connects to
> this database, where the application itself is on another RHEL 5.4
> server.

Let us call these Server A and Server B, respectively. Server B
connects to Server A using (typically) one of JDBC or Hibernate.

> Now, there's a different application (haven't been informed which
> tech. stack) wants to access the same database and connects via ODBC
> driver (I do not the details of how it does it; probably via a DSN).

Let us call this Server C. As you say, it will connect to Server A using ODBC.

> So the question is, if the application is on Linux too (RHEL / Fedora)
> how can one find the version of the driver?

Tried rpm -qa | grep -i odbc ?

The "standard' Unix ODBC suite is called (somewhat unimaginatively, I
should say) UnixODBC - www.unixodbc.org.

Basically, all RDBMS have some means by which applications can connect
to them; Postgres' is (used to be?) a library called libpq. You use
the API provided by libpq to connect to Postgres in your application.

This of course, has the problem that if you change the DB for any
reason, then you need to rewrite all your code. So solutions like ODBC
(and its Java counterpart, JDBC) emerged - your application will call
an intermediate layer ("middleware", if you like), which will
translate the query into the format accepted by the database. So, in
this case you'd have ODBC calls in your application, and a Postgres
ODBC driver will do the work of connecting to the database and
executing your queries. If you change the database, all you need to do
is to change the driver to that of the new database (and update
configuration); no code rewriting is necessary.

So ODBC solves a problem in non-Java world, and JDBC does the same in
Java world. Then you have ODBC to JDBC gateways and also ODBC - ODBC
gateways. There's an ODBC driver for most databases, and also to CSV
files, spreadsheets and to even things like NNTP articles. :-)


More information about the Linuxers mailing list