Re: PreparedStatement: setting column names dynamically

From: Chantal Ackermann <chantal(dot)ackermann(at)biomax(dot)de>
To: Dave Cramer <Dave(at)micro-automation(dot)net>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PreparedStatement: setting column names dynamically
Date: 2002-07-26 14:30:24
Message-ID: 3D415D00.2010108@biomax.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

hello Dave,

thank you for the link. it looks very interesting though I haven't found
a straight solution to my problem yet. but I might solve some of my
other problems using it. ;-)

cheers
Chantal

Dave Cramer wrote:

>Chantal,
>
>You probably want to do something like a persistence layer, look at
>castor, not sure of the url, but google castor persistence should give
>you something.
>
>Dave
>On Fri, 2002-07-26 at 07:25, Chantal Ackermann wrote:
>
>
>>hello all,
>>
>>sorry, if this has already been asked:
>>
>>Is it possible to set column or table names in a PreparedStatement
>>similar to setting values? I happen to do this very often and in a very
>>structured way. If it would be possible I could reuse the prepared
>>statement.
>>
>>what I mean is:
>>
>>at the moment I have a query like:
>>
>>"Select " + column + " from " + table + " where " + column + "=?";
>>
>>and I would like to have something like:
>>
>>"Select ? from ? where ?=?";
>>
>>I see that PreparedStatement doesn't provide any setColumn() methods or
>>whatever. but there might be some other way I am not aware off, I hope!
>>
>>Any ideas, suggestions, tips?
>>Thank you
>>Chantal
>>
>>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Håkon Hansen 2002-07-26 14:32:47 Re: Problem with JDBCRealm in Tomcat
Previous Message Ribamar FS 2002-07-26 14:15:55 Re: RES: [JDBC] Java access pgsql sample : Solution!!!