Skip site navigation (1) Skip section navigation (2)

Problem with JDBC driver: rs.next() is always null

From: Sasha <ber0806(at)iperbole(dot)bologna(dot)it>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Problem with JDBC driver: rs.next() is always null
Date: 2001-02-10 13:09:44
Message-ID: 3A853D98.2070308@iperbole.bologna.it (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hello there!

I'm trying to connect to a postgresql via the JDBC interface as follow:

...
Statement st=db.createStatement();
     ResultSet rs=st.executeQuery("select datname from pg_database");
     while(rs.next()){
       out.addItem(rs.getString(1));
       }
       rs.close();
       st.close();
....

The JVM throws a nullPointerException.
It seems that rs.next() is null even if the result set is not empty.

I'm working with Inprise Jbuilder 4 Foundation and Redhat Linux 7.0 
(kernel 2.2.16) running on my Athlon 750.

If anyone could help me I would appreciate.

P.S.:Sorry for my english!


Responses

pgsql-interfaces by date

Next:From: Hiroshi InoueDate: 2001-02-10 14:22:19
Subject: RE: 7.1 beta 3 Linux ODBC BEGIN Behaviour
Previous:From: Tom LaneDate: 2001-02-10 02:47:32
Subject: Re: Plan for straightening out the include-file mess

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group