Re: Newbie: connecting from windows to Linux: how-to?

Поиск
Список
Период
Сортировка
От Jean-Christian Imbeault
Тема Re: Newbie: connecting from windows to Linux: how-to?
Дата
Msg-id 3DA400C5.3020505@mega-bucks.co.jp
обсуждение исходный текст
Ответ на Newbie: connecting from windows to Linux: how-to?  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Ответы Re: Newbie: connecting from windows to Linux: how-to?  (Aaron Mulder <ammulder@alumni.princeton.edu>)
Список pgsql-jdbc
Laszlo Hornyak wrote:
> As much as I know Pg doesn`t build on windows. Maybe try it on linux.
>
> to check a jar file:
>  jar tf jarfile.jar
> if you see the class file, it is ok.

I'm using Pg on Linux but Java on Windows. The jar file seems fine using
the command you gave.

I did check that Pg is running with IP on ...

$ netstat -an | grep 5432 | grep LISTEN
unix  2      [ ACC ]     STREAM     LISTENING     1347   /tmp/.s.PGSQL.5432

I tried the test program suggested in the link given by Joe Shevland and
everything seems to be fine except for my connection string.

I have tried these various connection strings:

  Connection c = null;

   c1 =
DriverManager.getConnection("jdbc:postgresql://192.168.254.14/JC","postgres","");
   c2 =
DriverManager.getConnection("jdbc:postgresql://192.168.254.14:5432/JC","postgres","");

And get this error for both strings:

Checking if Driver is registered with DriverManager.
Couldn't find the driver!
Let's print a stack trace, and exit.
java.lang.ClassNotFoundException: org.postgresql.Driver
         at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:140)
         at Example1.main(Example1.java:10)
Jc


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

Предыдущее
От: Jean-Christian Imbeault
Дата:
Сообщение: Re: Newbie: connecting from windows to Linux: how-to?
Следующее
От: Jean-Christian Imbeault
Дата:
Сообщение: Re: Newbie: connecting from windows to Linux: how-to?