Switching from MySQL to PostgreSQL, JDBC drivers behaving differently

From: "Matthias Karlsson" <mc(at)kth(dot)se>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Switching from MySQL to PostgreSQL, JDBC drivers behaving differently
Date: 2007-03-04 14:12:26
Message-ID: 20070304141231.351EE14D8C7@smtp-2.sys.kth.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

I originally had a much longer mail written describing in detail why I had a
problem with my current framework, but I decided to go with a simple
question instead :)

If I submit the following query to PostgreSQL:

select a.*, b.* from A a
inner join B b on b.id = a.b_id

where (for instance) both A and B have a column named 'name', is it possible
to distinguish between the two without using explicit positioning with the
JDBC interface? That is, with the MySQL driver, I can write:

rs.getString("a.name") and rs.getString("b.name"), but this doesn't seem to
work with PostgreSQL.

Sincerely,
Matthias Karlsson

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Valery Meshkov 2007-03-04 19:00:08 BUG #3106: A problem with escaping table name pattern for DatabaseMetaData.getColumns()
Previous Message Alex Malone 2007-03-02 18:38:57 Re: TimestampUtils.toString() speedup