Re: java.sql.SQLException: No suitable driver

From: "Mads N(dot) Vestergaard" <mnv(at)timmy(dot)dk>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Subject: Re: java.sql.SQLException: No suitable driver
Date: 2006-04-28 11:04:23
Message-ID: 4451F6B7.6080009@timmy.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Oliver...

That seems to work just perfectly....

Oliver Jowett wrote:
> Mads N. Vestergaard wrote:
>> Hi Aliver,
>>
>> there isn't any conditional files in the environment variable CLASSPATH,
>> and the program runs fine, it just can't connect to the database.
>
> I am talking about both the CLASSPATH environment variable and the -cp
> command line argument. In my experience, if you specify -jar, both are
> ignored and classes are only loaded from the standard locations, and
> the single jarfile parameter given to -jar ("program.jar" in your case).
>
> Have you tried the command line I suggested?
>
>>> java -cp /usr/share/java/pg74.216.jdbc3.jar:program.jar
>>> ProgramMainClass
>
> Please try this and let us know if it works.
>
> I would also suggest that silently ignoring ClassNotFoundException, as
> the code you originally posted does, is a Really Bad Idea. That code
> is masking the real source of the error: namely, that the driver
> classes are *not* in your classpath.
>
> -O
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2006-04-28 12:00:14 Re: Bug with callable statement and output parameters
Previous Message Oliver Jowett 2006-04-28 10:24:57 Re: java.sql.SQLException: No suitable driver