* [Comm] Java + postgresql
@ 2003-06-18 7:42 Михаил Дворников
2003-06-18 16:20 ` Pavel Tsybulin
0 siblings, 1 reply; 2+ messages in thread
From: Михаил Дворников @ 2003-06-18 7:42 UTC (permalink / raw)
To: community (altlinux)
Спасибо за ответы!
Все когда-то начинали :)
В документации к Postgresql про try/catch ничего не сказано.
----
Вставил в программу try/catch. Компиляция прошла.
import java.sql.*;
class Msql {
public static void main(String args[]){
try{
Class.forName("org.postgresql.Driver");
Connection db = DriverManager.getConnection("jdbc:postgresql:test", "postgres","");
db.close();
}
catch (Exception e) {
System.out.println(e.getMessage()) ;
}
}
}
При запуске выдает сообщение: org.postgresql.Driver
Как я понял приизошла ошибка.
Если в присвоить CLASSPATH=/usr/share/pgsql,
то выдает "Exception in thread "main" java.lang.NoClassDefFoundError: Msql"
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Comm] Java + postgresql
2003-06-18 7:42 [Comm] Java + postgresql Михаил Дворников
@ 2003-06-18 16:20 ` Pavel Tsybulin
0 siblings, 0 replies; 2+ messages in thread
From: Pavel Tsybulin @ 2003-06-18 16:20 UTC (permalink / raw)
To: community,
Михаил
Дворников
On Wed, Jun 18, 2003 at 11:42:36AM +0400, Михаил Дворников wrote:
> Спасибо за ответы!
> Все когда-то начинали :)
> В документации к Postgresql про try/catch ничего не сказано.
> ----
Документация по Postgre не есть документация по джаве )
> Вставил в программу try/catch. Компиляция прошла.
Это еще ни о чем не говорит
>
>
> Если в присвоить CLASSPATH=/usr/share/pgsql,
> то выдает "Exception in thread "main" java.lang.NoClassDefFoundError: Msql"
>
А где лежит Msql.class ? в текущей директории ?
тогда почему в он CLASSPATH отсутствует ?
export CLASSPATH=.:/usr/share/pgsql.jar <- вот тут укажите
с точностью до jar файла
И вообще, купите книжку по джаве....
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-06-18 16:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-18 7:42 [Comm] Java + postgresql Михаил Дворников
2003-06-18 16:20 ` Pavel Tsybulin
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git