pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter T Mount <peter@retep.org.uk>
To: Sasha <ber0806@iperbole.bologna.it>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Problem with JDBC driver: rs.next() is always null
Date: Tue, 13 Feb 2001 05:00:03 -0500 (EST)
Message-ID: <982058403.3a8905a38f4bb@webmail.retep.org.uk> (raw)
In-Reply-To: <3A853D98.2070308@iperbole.bologna.it>
References: <3A853D98.2070308@iperbole.bologna.it>

Quoting Sasha <ber0806@iperbole.bologna.it>:

> 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.

rs should never be null from executeQuery(), and never from this one.

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

What version of the driver? I've just tested with the latest and this doesn't 
fail.

Peter

> 
> If anyone could help me I would appreciate.
> 
> P.S.:Sorry for my english!
> 
> 



-- 
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/



view thread (2+ messages)

Message-ID: <982058403.3a8905a38f4bb@webmail.retep.org.uk>
Permalink:  ../982058403.3a8905a38f4bb@webmail.retep.org.uk/
Also on:    postgresql.org/message-id/982058403.3a8905a38f4bb@webmail.retep.org.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: peter@retep.org.uk, ber0806@iperbole.bologna.it
  Subject: Re: Problem with JDBC driver: rs.next() is always null
  In-Reply-To: <982058403.3a8905a38f4bb@webmail.retep.org.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox