Re: I just can't use the org.postgresql.Driver class... Please help!

Поиск
Список
Период
Сортировка
От Guy Rouillier
Тема Re: I just can't use the org.postgresql.Driver class... Please help!
Дата
Msg-id CC1CF380F4D70844B01D45982E671B230137A842@mtxexch01.add0.masergy.com
обсуждение исходный текст
Ответ на I just can't use the org.postgresql.Driver class... Please help!  (Kamal <kalotus@gmail.com>)
Ответы Re: I just can't use the org.postgresql.Driver class... Please help!  ("Andres Olarte" <olarte.andres@gmail.com>)
Список pgsql-jdbc
Kamal wrote:
> Hi everybody.
> Thi is my first time trying to use postgresql jdbc and I'm very
> frustrated.
>
> This is my env:
>
> C:\>java -version
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
>
> I have these files in the same directory:
>
> Simple source file (JasperReportsTest.java):
>
> public class JasperReportsTest
> {
>    public static void main(String[] args)
>    {
>
>    Class.forName("org.postgresql.Driver");
>
>    }
> }
>
> Simple batch file to compile it (JasperReportsTest.bat):
>
> set CLASSPATH=postgresql-8.1-405.jdbc3.jar
> javac JasperReportsTest.java > javac.log 2>&1
>
>
> Simple log file making me crazy (javac.log):
>
> JasperReportsTest.java:6: unreported exception
>    java.lang.ClassNotFoundException; must be caught or declared to be
>                 thrown Class.forName("org.postgresql.Driver"); ^
> 1 error
>
> Obviously the file postgresql-8.1-405.jdbc3.jar is there...
>
> Why does it say ClassNotFound if the file is there? Can anyone help
> me? Thank you : )

Try providing it with a path to the jar file instead of just the jar
file name: ./postgresql-8.1-405.jdbc3.jar.  Might as well add the
current directory to that so it doesn't complain about the source file
you're trying to compile.

--
Guy Rouillier


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "markds75"
Дата:
Сообщение: PostgreSQL (XADataSource) as Tomcat Resource
Следующее
От: "Guy Rouillier"
Дата:
Сообщение: Re: PostgreSQL (XADataSource) as Tomcat Resource