Re: Problem using PostgreSQL 9.0.4 with Java

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem using PostgreSQL 9.0.4 with Java
Date: 2011-09-07 21:36:15
Message-ID: 4E67E3CF.2010908@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/07/11 1:45 PM, Arun Nadar wrote:
>
> but it work by putting " ", like this SELECT "Id", "Name" FROM
> "Student" ORDER BY "Id";
>
> in java String, inside of double inverted commas another is does not
> possible.

String sql="SELECT \"Id\", \"Name\" FROM \"Student\" ORDER BY \"Id\"";

Alternately, create your table with all lower case names, and you won't
have this problem.

alter table "Student" rename to student;
alter table student rename column "Id" to id;
alter table student rename column "Name" to name;

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Redekop 2011-09-07 21:43:13 Re: Demoting master to slave without an rsync...is it safe?
Previous Message Tomas Vondra 2011-09-07 21:35:43 Re: Problem using PostgreSQL 9.0.4 with Java