Connecting through JdbcOdbcDriver from Servlets

From: Anuj(at)mannindia(dot)com
To: pgsql-admin(at)postgresql(dot)org
Subject: Connecting through JdbcOdbcDriver from Servlets
Date: 2000-10-13 19:07:01
Message-ID: 20001013190701.25284.cpmta@c004.sfo.cp.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,

I have written a servlet to connectto a PostgreSQL database on Linux 6.2.

I am using JdbcOdbcDriver. When I am running the servlet from JSWDK on
Windows NT , it works fine .

But when I try to run it from JSWDK on Linux , it gives an exception "No Suitable Driver".

My code is like this:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
DriverManager.getConnection("jdbc:odbc:cards","anuj","")

the .odbc.ini file is kept in "/" directory and it is:

[ODBC Data Sources]
cards = PostgreSQL

[cards]
Driver = /usr/local/pgsql/lib/libpgsqlodbc.so.1
Database = cards
UID = anuj
Host = localhost
Port = 5432

The error is coming in when I try to do getConnection.

If anybody could help me in this, please. I believe there must be something wrong in Configuration,as the same code works from JWSDK on NT.

TIA,
Anuj.

Anuj Paul
_______________________________________
Click here to get your free domain name
and personal portal from NAMEzero(TM):
http://www.namezero.com

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David Huttleston Jr 2000-10-14 05:04:47 Re: Connecting through JdbcOdbcDriver from Servlets
Previous Message Alexey Rodriguez Yakushev 2000-10-13 09:00:52 pg_hba.conf problems with Postgresql 7.0.2