pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matt Fair <matt@netasol.com>
To: Peter Mount <peter@retep.org.uk>
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: JDBC Query bug
Date: Sun, 16 Jul 2000 14:36:37 -0500
Message-ID: <39720EC4.80D097C8@netasol.com> (raw)
References: <3970A8C4.6B2DBE3A@netasol.com>
	<008a01bfef01$398b4ee0$5f3429d4@retep.org.uk>

I query SELECT usename FROM pg_user WHERE usename ~* 'star_.*'; in the psql
command line.  I get a result in the command line, but not one when I do the
same query in jdbc.  It seems to screw up when I do a WHERE query.

I am only expecting 1 result to come back, but in the java code as seen below,
the rs is empty.   So rs.next() == false.

ResultSet rs;
      rs = null;
      rs = this.executeQuery(SELECT usename FROM pg_user WHERE usename ~*
'star_.*')l
      CarrotData.instance().assert("this i cannot allow (having a null
ResultSet)!", rs != null);
      while (rs.next()) {
        ret.addElement(rs.getString("usename"));
      }
    } catch (SQLException e) {
      CarrotData.instance().error(e);
    }


Thanks
Matt

Peter Mount wrote:

> Probably the backend. What do you get if you run this query from psql?
>
> JDBC currently does nothing to the SQL before passing it to the backend.
>
> Peter
>
> --
> Peter T Mount peter@retep.org.uk, peter@retepdigital.com, me@petermount.com
> Homepage: http://www.retep.org.uk Contact details @ http://petermount.com
> PostgreSQL JDBC: http://www.retep.org.uk/postgres/
> Java PDF generator: http://www.retep.org.uk/pdf/
>
> ----- Original Message -----
> From: Matt Fair <matt@netasol.com>
> To: <pgsql-interfaces@postgreSQL.org>
> Sent: Saturday, July 15, 2000 7:09 PM
> Subject: [INTERFACES] JDBC Query bug
>
> > This jdbc is messing up on basic select/where queries.  For example:
> > SELECT usename FROM pg_user WHERE usename ~* 'star_.*';
> >
> > usename
> > ---------
> > star_admin
> >
> > But in jdbc I do:
> >
> > SELECT usename FROM pg_user WHERE usename ~* 'star_.*';
> >
> > I get an empty result set.
> > rs.next() is false.
> >
> > What would be causing this?
> > Matt
> >




view thread (3+ messages)

Message-ID: <39720EC4.80D097C8@netasol.com>
Permalink:  ../39720EC4.80D097C8@netasol.com/
Also on:    postgresql.org/message-id/39720EC4.80D097C8@netasol.com

 · 

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: matt@netasol.com, peter@retep.org.uk
  Subject: Re: JDBC Query bug
  In-Reply-To: <39720EC4.80D097C8@netasol.com>

* 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