Обсуждение: java.sql.SQLException: No suitable driver

Поиск
Список
Период
Сортировка

java.sql.SQLException: No suitable driver

От
Yunush Mulla
Дата:
Hi,
I m developing a application in which  i need to connect to postgres Database lying on remote host.
when I tried to connect to remote database Using following code:

connection=DriverManager.getConnection("jdbc:postgresql://"+host+":"+port+"/sms",user,pwd);

 I got error like this:
java.sql.SQLException: No suitable driver

what could be the cause? What could be the solution???


Relax. Yahoo! Mail virus scanning helps detect nasty viruses!

Re: java.sql.SQLException: No suitable driver

От
Brendan Duddridge
Дата:
That usually means your jdbc driver can't be found in your java classpath.

____________________________________________________________________
Brendan Duddridge | CTO | 403-277-5591 x24 |  brendan@clickspace.com

ClickSpace Interactive Inc.
Suite L100, 239 - 10th Ave. SE
Calgary, AB  T2G 0V9

http://www.clickspace.com 

On Mar 10, 2006, at 12:44 AM, Yunush Mulla wrote:

Hi,
I m developing a application in which  i need to connect to postgres Database lying on remote host.
when I tried to connect to remote database Using following code:

connection=DriverManager.getConnection("jdbc:postgresql://"+host+":"+port+"/sms",user,pwd);

 I got error like this:
java.sql.SQLException: No suitable driver

what could be the cause? What could be the solution???



Relax. Yahoo! Mail virus scanning helps detect nasty viruses!

Вложения

Re: java.sql.SQLException: No suitable driver

От
Kris Jurka
Дата:

On Thu, 9 Mar 2006, Yunush Mulla wrote:

> connection=DriverManager.getConnection("jdbc:postgresql://"+host+":"+port+"/sms",user,pwd);
>
> java.sql.SQLException: No suitable driver
>

Have you done a Class.forName("org.postgresql.Driver"); ?

Kris Jurka