My query table aliases don't exist in my application

From: Hugo Garza <hiro2k(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: My query table aliases don't exist in my application
Date: 2011-02-01 22:23:06
Message-ID: AANLkTimBHzeWSsKxC7ZhziKiehCmCgyiUdD3Q76yNrSy@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello everyone,

I'm going a complex join on 5 tables and some of them have a column that
repeats in two tables called "name". So I created an alias for each table,
one of them called co, and in my application I do a result.getString("
co.name"). But the application fails with: "The column name co.name was not
found in this ResultSet."

When I test this same code against a MySQL database it returns the right
column. I tried doing just a result.getString("name") but as I expected it
just returned the first column called "name" instead of the one I want.

Is this a bug in the JDBC driver, or am I doing it wrong?

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kevin Grittner 2011-02-01 22:48:00 Re: My query table aliases don't exist in my application
Previous Message ml-tb 2011-01-27 10:41:23 Double quoted column name from DatabaseMetaData.getIndexInfo