Re: JDBC Query bug

Поиск
Список
Период
Сортировка
От Matt Fair
Тема Re: JDBC Query bug
Дата
Msg-id 39720EC4.80D097C8@netasol.com
обсуждение исходный текст
Ответ на JDBC Query bug  (Matt Fair <matt@netasol.com>)
Список 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
(SQLExceptione) {     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
> >



В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Cedar Cox
Дата:
Сообщение: Re: more ODBC driver
Следующее
От: Matt Fair
Дата:
Сообщение: JDBC Source