Re: No suitable driver found

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "John Dunlap *EXTERN*" <john(dot)dunlap(at)exceter(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: No suitable driver found
Date: 2009-07-27 08:04:01
Message-ID: D960CB61B694CF459DCFB4B0128514C203937E6A@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Markus Kickmaier 2009-07-27 08:23:47 Re: Encoding from CopyManager.copyIn()
Previous Message Kris Jurka 2009-07-27 06:30:22 Re: No suitable driver found