pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedProblem with JDBC driver: rs.next() is always null
2+ messages / 2 participants
[nested] [flat]
* Problem with JDBC driver: rs.next() is always null
@ 2001-02-10 13:09 Sasha <ber0806@iperbole.bologna.it>
2001-02-13 10:00 ` Re: Problem with JDBC driver: rs.next() is always null Peter T Mount <peter@retep.org.uk>
0 siblings, 1 reply; 2+ messages in thread
From: Sasha @ 2001-02-10 13:09 UTC (permalink / raw)
To: 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!
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Problem with JDBC driver: rs.next() is always null
2001-02-10 13:09 Problem with JDBC driver: rs.next() is always null Sasha <ber0806@iperbole.bologna.it>
@ 2001-02-13 10:00 ` Peter T Mount <peter@retep.org.uk>
0 siblings, 0 replies; 2+ messages in thread
From: Peter T Mount @ 2001-02-13 10:00 UTC (permalink / raw)
To: Sasha <ber0806@iperbole.bologna.it>; +Cc: pgsql-interfaces
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/
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-02-13 10:00 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-10 13:09 Problem with JDBC driver: rs.next() is always null Sasha <ber0806@iperbole.bologna.it>
2001-02-13 10:00 ` Peter T Mount <peter@retep.org.uk>
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