Обсуждение: jdbc7.0-1.2.jar problems

Поиск
Список
Период
Сортировка

jdbc7.0-1.2.jar problems

От
Lars Nielsen Lind
Дата:
Hi.

I have some problems with PostgreSQL 7.0.2 and JBuilder 4 Foundation and
JavaServer Pages.
My development platform is Red Hat 7.0 and JDK 1.3.

When I try to compile my JavaBean (DatabaseHandler) it freeze's when it
reach the no. 2
codeline (prints "1" - and thats it.):

1.) System.out.println("1");
2.) conn =
DriverManager.getConnection("jdbc:postgresql:testdatabase","user","1234");

3.) System.out.println("2");

Where "user" = linux database admin, and "1234" = linux password.

JBuilder never finishes the compile sequence....and when I use the
JavaBean with JavaServer
Pages I get a java.lang.NullPointerException.

I start the PostgreSQL database server with this command:

/usr/bin/postmaster -D -i /home/user/databaseserver

I have added the following line to /etc/profile:
CLASSPATH=$CLASSPATH:/usr/lib/pgsql/jdbc7.0-1.2.jar, and I have also
added: /usr/lib/pgsql/jdbc7.0-1.2.jar to PATH in /etc/profile.

In JBuilder 4 Foundation the /usr/lib/pgsql/jdbc7.0-1.2.jar have been
added to the Class tab in
the Configure JDKs dialog box.

Some of my friends told me to unpack the jdbc7.0-1.2.jar file and place
the org package inside tomcat/webapps/root/classes - but I have not
tried that yet.

But anyway - it would be nice to use the postgresql database server from
both JBuilder 4 Foundation and JavaServer Pages (Tomcat).

Thanks.


Lars Nielsen Lind
E-mail address: larslind@systemudvikling.dk




RE: jdbc7.0-1.2.jar problems

От
Peter Mount
Дата:
Answers prefixed with PM:

-- 
Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: petermount@maidstone.gov.uk
WWW: http://www.maidstone.gov.uk
All views expressed within this email are not the views of Maidstone Borough
Council


-----Original Message-----
From: Lars Nielsen Lind [mailto:larslind@systemudvikling.dk]
Sent: Tuesday, November 28, 2000 8:48 AM
To: pgsql-interfaces@postgresql.org
Subject: [INTERFACES] jdbc7.0-1.2.jar problems


Hi.

I have some problems with PostgreSQL 7.0.2 and JBuilder 4 Foundation and
JavaServer Pages.
My development platform is Red Hat 7.0 and JDK 1.3.

When I try to compile my JavaBean (DatabaseHandler) it freeze's when it
reach the no. 2
codeline (prints "1" - and thats it.):

1.) System.out.println("1");
2.) conn =
DriverManager.getConnection("jdbc:postgresql:testdatabase","user","1234");

3.) System.out.println("2");

Where "user" = linux database admin, and "1234" = linux password.

JBuilder never finishes the compile sequence....and when I use the
JavaBean with JavaServer
Pages I get a java.lang.NullPointerException.

PM: JBuilder hangs while building?

I start the PostgreSQL database server with this command:

/usr/bin/postmaster -D -i /home/user/databaseserver

I have added the following line to /etc/profile:
CLASSPATH=$CLASSPATH:/usr/lib/pgsql/jdbc7.0-1.2.jar, and I have also
added: /usr/lib/pgsql/jdbc7.0-1.2.jar to PATH in /etc/profile.

PM: CLASSPATH should be enough. PATH is for executables, so unless you have
the kernel compiled to recognise .jar as an executable it's not going to be
useful.

In JBuilder 4 Foundation the /usr/lib/pgsql/jdbc7.0-1.2.jar have been
added to the Class tab in
the Configure JDKs dialog box.

PM: Are you loading the driver using Class.forName("org.postgresql.Driver");
?

Some of my friends told me to unpack the jdbc7.0-1.2.jar file and place
the org package inside tomcat/webapps/root/classes - but I have not
tried that yet.

PM: Eeek! Except for applets on old browsers, you shouldn't unpack the .jar
file. Unpacking can cause problems with PSQLException (it uses resources in
the .jar file), future upgrades etc. Also, 7.1 will have a proper Manifest
in the .jar file, which may have problems if it's unpacked.

PM: Try putting the .jar file into the jre/lib/ext directory. All .jar files
in here are searched by the JVM regardless of what CLASSPATH is set to.

But anyway - it would be nice to use the postgresql database server from
both JBuilder 4 Foundation and JavaServer Pages (Tomcat).

Thanks.


Lars Nielsen Lind
E-mail address: larslind@systemudvikling.dk