From: Nick Fankhauser <nickf@ontko.com>
To: Mike Kenny - CPX Mngd Services <Mike.Kenny@Comparex.co.za>
To: JDBC (E-mail) <pgsql-jdbc@postgresql.org>
Subject: Re: No suitable driver
Date: Fri, 24 Oct 2003 16:30:08 -0500
Message-ID: <NEBBLAAHGLEEPCGOBHDGEEOFJBAA.nickf@ontko.com> (raw)
In-Reply-To: <A2AE62FF85AEAC4BA3DE695E3C237D110AD379@exmid04.africa.enterprise.root>
Mike-
It looks to me like your URL for the connection is malformed. It should be
one of the following:
jdbc:postgresql:databasename
jdbc:postgresql://host/databasename
jdbc:postgresql://host:port/databasename
Take a look at this FAQ for more (There is also a "helloworld" example that
may be useful in the FAQ):
http://www.fankhausers.com/postgresql/jdbc/#nosuitabledriver
-Nick
-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Mike Kenny - CPX Mngd
Services
Sent: Thursday, October 23, 2003 4:55 AM
To: JDBC (E-mail)
Subject: [JDBC] No suitable driver
My code is quite simple
try {
Class.forName("org.postgres.Driver");
} catch(ClassNotFoundException nfe) {
nfe.printStackTrace();
}
try {
db = DriverManager.getConnection("jdbc:databasename", "id", "password");
} catch(SQLException se) {
se.printStackTrace();
}
on execution I receive a SQLException stating that there is no suitable
driver
This is my first time trying to connect to postgreSQL and I am stuck.
Any advice appreciated (career change is not an option :-)
Mike Kenny
Principal Consultant
Comparex Africa (Pty) Ltd
Managed Services
* e-mail: mike.kenny@comparex.co.za
( Tel(W): +27 (0)11 266-5703
È Cell: +27 (0)83 266-1437
NOTICE: This message and any attachments are confidential and intended
solely for the addressee. If you have received this message in error,
please notify Dave Gilbert at Comparex Africa (Pty) Ltd immediately,
telephone number +27 (0) 11 266 5204. Any unauthorised use, alteration or
dissemination is prohibited. Comparex Africa (Pty) Ltd accepts no liability
whatsoever for any loss whether it be direct, indirect or consequential,
arising from information made available and actions resulting there from.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: nickf@ontko.com, Mike.Kenny@Comparex.co.za
Subject: Re: No suitable driver
In-Reply-To: <NEBBLAAHGLEEPCGOBHDGEEOFJBAA.nickf@ontko.com>
References: <A2AE62FF85AEAC4BA3DE695E3C237D110AD379@exmid04.africa.enterprise.root> <NEBBLAAHGLEEPCGOBHDGEEOFJBAA.nickf@ontko.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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