Received: from cda.mrs.umn.edu (root@cda.mrs.umn.edu [146.57.3.11]) by hub.org (8.10.1/8.10.1) with ESMTP id e6GJaM095460 for ; Sun, 16 Jul 2000 15:36:23 -0400 (EDT) Received: from netasol.com (ctrts1-1.mrs.umn.edu [146.57.4.201]) by cda.mrs.umn.edu (8.10.0/8.10.0) with ESMTP id e6GJaF118903; Sun, 16 Jul 2000 14:36:15 -0500 (CDT) Message-ID: <39720EC4.80D097C8@netasol.com> Date: Sun, 16 Jul 2000 14:36:37 -0500 From: Matt Fair Organization: Netasol Networks, Inc. X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i586) X-Accept-Language: en MIME-Version: 1.0 To: Peter Mount CC: pgsql-interfaces@postgreSQL.org Subject: Re: JDBC Query bug References: <3970A8C4.6B2DBE3A@netasol.com> <008a01bfef01$398b4ee0$5f3429d4@retep.org.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200007/104 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 > To: > 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 > >