Re: PreparedStatement: setting column names dynamically - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: PreparedStatement: setting column names dynamically
Date
Msg-id 1027689220.30770.85.camel@inspiron.cramers
Whole thread Raw
In response to PreparedStatement: setting column names dynamically  (Chantal Ackermann <chantal.ackermann@web.de>)
List pgsql-jdbc
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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>




pgsql-jdbc by date:

Previous
From: "Ribamar FS"
Date:
Subject: Re: RES: Java access pgsql sample
Next
From: Håkon Hansen
Date:
Subject: Problem with JDBCRealm in Tomcat