from UNIX to postgresql in Linux

Поиск
Список
Период
Сортировка
От Rudianto Sugiyarto
Тема from UNIX to postgresql in Linux
Дата
Msg-id F227zpWSsCVdUygUnSb00010e8d@hotmail.com
обсуждение исходный текст
Ответы Re: from UNIX to postgresql in Linux
Список pgsql-jdbc
Hi,

I need some help on how to execute some SQL commands using a java program
run in a UNIX server to update postgresql database installed on a Linux
workstation. This server and workstation are connected through LAN.

I have installed the postgresql with java support (JDBC). I have also define
the CLASSPATH variable.

$ echo $CLASSPATH
/usr/lib/jdk-1.1.6/lib/classes.zip:/usr/local/lib/finder.jar:/usr/local/pgsql/sh
are/java/postgresql.jar:.:/opt/IBMJava2-13/javasrc.jar:.:/home/rudy

I anc run the program in the Linux workstation but when I try to run it in
the UNIX server (HP-UX) there is error :

java.lang.ClassNotFoundException: org.postgresql.Driver
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at db.main(db.java:15)

part of the program :

String url="jdbc:postgresql://"+linuxIPAddress+"/"+databaseName;

Class.forName("org.postgresql.driver"); // <- this is the line 15
Connection db=DriverManager.getConnection(url, "user", "password");

Statement a=db.createStatement();

ResultSet rs=a.executeQuery("SELECT * FROM "+tableName);

I have installed the database and create the table
OK that's all thanks for your help

Rudi


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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

Предыдущее
От: Barry Lind
Дата:
Сообщение: Re: [ADMIN] DB Access Restrictions
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: from UNIX to postgresql in Linux