Re: No suitable driver found - Mailing list pgsql-jdbc

From Albe Laurenz
Subject Re: No suitable driver found
Date
Msg-id D960CB61B694CF459DCFB4B0128514C203937E6A@exadv11.host.magwien.gv.at
Whole thread Raw
In response to No suitable driver found  (John Dunlap <john.dunlap@exceter.com>)
Responses Re: No suitable driver found  (John Dunlap <john.dunlap@exceter.com>)
List pgsql-jdbc
John Dunlap wrote:

> I've been looking for a solution to this error for a few days now.
> Everything I've found says that the problem should be that I have a
> malformed url but I've gone over it dozens of times and I don't think
> that it's wrong (I wish it was). I'm trying to use hibernate tools to
> generate my database schema through the JDBC driver.
>
> I'm getting the following stack trace,
> java.sql.SQLException: No suitable driver found for
> jdbc:postgresql://localhost:5432/mydatabase
>     at java.sql.DriverManager.getConnection(DriverManager.java:602)
[...]

I don't know anything about Hibernate, but this error suggests that
the system does not know the PostgreSQL JDBC driver.

There are several ways to register it:
- Use the class org.postgresql.Driver, for example with the statement
  Class.forName("org.postgresql.Driver");

- Start the Java Virtual Machine with the flag
  -Djdbc.drivers=org.postgresql.Driver

You'll probably have to figure out how to do that in Hibernate,
but it should work exactly as with other JDBC drivers.

Yours,
Laurenz Albe

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: No suitable driver found
Next
From: Clemens Eisserer
Date:
Subject: Re: Updateable ResultSet doesn't fetch sequence-generated values