pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Connecting through JdbcOdbcDriver from Servlets
2+ messages / 2 participants
[nested] [flat]

* Connecting through JdbcOdbcDriver from Servlets
@ 2000-10-13 19:07  Anuj@mannindia.com
  0 siblings, 1 reply; 2+ messages in thread

From: Anuj@mannindia.com @ 2000-10-13 19:07 UTC (permalink / raw)
  To: 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Connecting through JdbcOdbcDriver from Servlets
@ 2000-10-14 05:04  David Huttleston Jr <dhjr@hddesign.com>
  parent: Anuj@mannindia.com
  0 siblings, 0 replies; 2+ messages in thread

From: David Huttleston Jr @ 2000-10-14 05:04 UTC (permalink / raw)
  To: Anuj@mannindia.com; +Cc: pgsql-admin

There is no ODBC Driver Manager installed in Linux by default.  You will
need to install a Third-Party product to give your Linux box the ability 
to see ODBC sources.  If the database you are trying to query is postgres
on linux, use Peter Mount's JDBC driver included with postgres.  It is
must faster and more stable than the JDBC-ODBC bridge.  In fact,
you should use this on your NT box too, it is far superior.
Good Luck,
	Dave Huttleston

On 13 Oct 2000 12:07:01 -0700, you wrote:
> 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
> 
> 



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-10-14 05:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-10-13 19:07 Connecting through JdbcOdbcDriver from Servlets Anuj@mannindia.com
2000-10-14 05:04 ` David Huttleston Jr <dhjr@hddesign.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox