postgres jdbc class problem

Поиск
Список
Период
Сортировка
От Richard Morrell
Тема postgres jdbc class problem
Дата
Msg-id Pine.LNX.3.96.990930162012.19261B-100000@faure.ednet.co.uk
обсуждение исходный текст
Список pgsql-interfaces
Hi,

I'm writing a simple java applet that queries a postgres database using
JDBC.  The applet works fine in the appletviewer and in some copies of
Netscape and MSIE.  However, in most copies of Netscape and MSIE it
returns a NullPointerException.  The java console error messages aren't
that helpful, so I looked at my web server logs.  For the browsers which
are failing I noticed that they are requesting extra class files which
don't seem to be part of the postgres jdbc driver: 

[Thu Sep 30 15:28:05 1999] [error] [client 195.89.132.20] File does not
exist: /home/richard/public_html/postgresql/errors_en_US.class
[Thu Sep 30 15:28:05 1999] [error] [client 195.89.132.20] File does not
exist: /home/richard/public_html/postgresql/errors_en.class
[Thu Sep 30 15:28:05 1999] [error] [client 195.89.132.20] File does not
exist: /home/richard/public_html/postgresql/errors_en_US.class
[Thu Sep 30 15:28:05 1999] [error] [client 195.89.132.20] File does not
exist: /home/richard/public_html/postgresql/errors_en.class
[Thu Sep 30 15:28:05 1999] [error] [client 195.89.132.20] File does not
exist: /home/richard/public_html/postgresql/errors.class

Here is the java console message from netscape 4.6:

Netscape Communications Corporation -- Java 1.1.5
Type '?' for options.
Symantec Java! ByteCode Compiler Version 210.065
Copyright (C) 1996-97 Symantec Corporation
# Applet exception: java.lang.NullPointerException
java.lang.NullPointerException at postgresql.util.PSQLException.translate(Compiled Code) at
postgresql.util.PSQLException.<init>(CompiledCode) at postgresql.Driver.connect(Compiled Code) at
java.sql.DriverManager.getConnection(CompiledCode)
 
* at java.sql.DriverManager.getConnection(Compiled Code) at OutputApplet.run(Compiled Code) at
java.lang.Thread.run(CompiledCode)
 
java.io.IOException: CreateProcess: vcafe -netscape error=0 at java.lang.Win32Process.<init>(Compiled Code) at
java.lang.Runtime.exec(CompiledCode)
 
* at java.lang.Runtime.exec(Compiled Code) at netscape.debug.Debugger.launchDebugger(Compiled Code) at
netscape.debug.Debugger.uncaughtException(CompiledCode) at netscape.applet.AppletThreadGroup.uncaughtException(Compiled
Code)

I'm using postgres 6.5.1 with the new 6.5.1-2 JDBC driver that I
downloaded from www.retep.org.uk.  My code is faily straightforward:

public void run() {String url = "jdbc:postgresql://faure.ednet.co.uk/software";String query = "select * from
software";
try {    //
Class.forName("postgresql.Driver");DriverManager.registerDriver((Driver)Class.forName("postgresql.Driver").newInstance());}
catch(Exceptionex) {    setError("driver class: " + ex);    return;}
 
try {    Vector results = new Vector();    Connection con = DriverManager.getConnection(url,
"username","password");    Statement stmt = con.createStatement();    ResultSet rs = stmt.executeQuery(query);    while
(rs.next()){    String s = rs.getString("description");    int level = rs.getInt("ladder_level");    String text =
level+ "   " + s;    results.addElement(text);    }
 
    stmt.close();    con.close();
    setResults(results);
} catch(SQLException ex) {    setError("SQLException: " + ex);}


Does anyone have any ideas about what might be wrong here?

--
Richard Morrell                                           richard@ednet.co.uk
Operations Manager - edNET: InternetWorkingSolutions - http://www.ednet.co.uk








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

Предыдущее
От: zhang-lan@usa.net
Дата:
Сообщение: Access database via Servlet
Следующее
От: Lamar Owen
Дата:
Сообщение: Web Interfaces Information