pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC Query bug
3+ messages / 2 participants
[nested] [flat]

* JDBC Query bug
@ 2000-07-15 18:09 Matt Fair <matt@netasol.com>
  2000-07-16 08:36 ` Re: JDBC Query bug Peter Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 3+ messages in thread

From: Matt Fair @ 2000-07-15 18:09 UTC (permalink / raw)
  To: pgsql-interfaces

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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: JDBC Query bug
  2000-07-15 18:09 JDBC Query bug Matt Fair <matt@netasol.com>
@ 2000-07-16 08:36 ` Peter Mount <peter@retep.org.uk>
  2000-07-16 19:36   ` Re: JDBC Query bug Matt Fair <matt@netasol.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Peter Mount @ 2000-07-16 08:36 UTC (permalink / raw)
  To: Matt Fair <matt@netasol.com>; pgsql-interfaces

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
> 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: JDBC Query bug
  2000-07-15 18:09 JDBC Query bug Matt Fair <matt@netasol.com>
  2000-07-16 08:36 ` Re: JDBC Query bug Peter Mount <peter@retep.org.uk>
@ 2000-07-16 19:36   ` Matt Fair <matt@netasol.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Matt Fair @ 2000-07-16 19:36 UTC (permalink / raw)
  To: Peter Mount <peter@retep.org.uk>; +Cc: pgsql-interfaces

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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2000-07-16 19:36 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-07-15 18:09 JDBC Query bug Matt Fair <matt@netasol.com>
2000-07-16 08:36 ` Peter Mount <peter@retep.org.uk>
2000-07-16 19:36   ` Matt Fair <matt@netasol.com>

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