pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
org.postgresql.util.PSQLException Column name candidates.id wasn't found in the ResultSet
2+ messages / 2 participants
[nested] [flat]

* org.postgresql.util.PSQLException Column name candidates.id wasn't found in the ResultSet
@ 2005-11-24 13:58  Roman Chervotkin <roman.chervotkin@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Roman Chervotkin @ 2005-11-24 13:58 UTC (permalink / raw)
  To: pgsql-jdbc

Hi, there.
May be silly question but I can't understand it.

I have query in my application "SELECT * FROM candidates WHERE
candidates.id=?"

so after query executed I've got exception
 *Exception Details: * org.postgresql.util.PSQLException
  Der Spaltenname candidates.id wurde in diesem ResultSet nicht gefunden,

But if remove tablename from query and just leave column name like this "SELECT
* FROM candidates WHERE id=?" query executed without a problem. But from
phpmyadmin both these queries worked.
I tried this for two tables and get the same results.

I'm using Postgresql 8.1 with postgresql-8.1-404.jdbc3.jar

Thanks,
Roman.

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

* Re: org.postgresql.util.PSQLException Column name candidates.id
@ 2005-11-24 19:52  Kris Jurka <books@ejurka.com>
  parent: Roman Chervotkin <roman.chervotkin@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2005-11-24 19:52 UTC (permalink / raw)
  To: Roman Chervotkin <roman.chervotkin@gmail.com>; +Cc: pgsql-jdbc



On Thu, 24 Nov 2005, Roman Chervotkin wrote:

> I have query in my application "SELECT * FROM candidates WHERE
> candidates.id=?"
>
> so after query executed I've got exception
> *Exception Details: * org.postgresql.util.PSQLException
>  Der Spaltenname candidates.id wurde in diesem ResultSet nicht gefunden,
>

This error is complaining about calling ResultSet.getXXX("candidates.id"), 
not the execution of the query.  You need to call getXXX("id"), you may 
not qualify resulting column with the source tablename.

Kris Jurka



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


end of thread, other threads:[~2005-11-24 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-24 13:58 org.postgresql.util.PSQLException Column name candidates.id wasn't found in the ResultSet Roman Chervotkin <roman.chervotkin@gmail.com>
2005-11-24 19:52 ` Re: org.postgresql.util.PSQLException Column name candidates.id Kris Jurka <books@ejurka.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