|
|
Sponsor |
Re: ANY subquery and PreparedStatements: msg#00286db.postgresql.jdbc
This is impossible because of the framework we use here... The SQLs aren't stored in java code, but in a separate XML file On Wed, 2003-02-19 at 15:12, David Wall wrote: > > You're right... but it's actually based on user interaction (i.e.: > > selecting items using checkboxes) > > I guess I'll just have to issue a query per item... ugly :-( > > Why can't you simply build the prepared statement on the fly based on the > number of values to be placed in the IN list? If you have 3 items, you just > append three '?' and if you have 20 items, then you append 20 '?' to your > list. This way the number of '?' will match the number of > PreparedStatement.setXXX() calls and you don't have to rely on the database > handling all the nulls. Since the list is fairly dynamic anyway, it's > overall performance will be about the same (and it's much better than doing > a series of queries instead). > > Of course, there are limits on how long a query can be for most databases, > so you may find that if the list is too long, you'll run into query > processor problems. > > David > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster -- Felipe Schnack Analista de Sistemas felipes@xxxxxxxxxxxxxxxx Cel.: (51)91287530 Linux Counter #281893 Centro Universitário Ritter dos Reis http://www.ritterdosreis.br ritter@xxxxxxxxxxxxxxxx Fone/Fax.: (51)32303341 ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: SSL for JDBC, Nagy Istvan |
|---|---|
| Next by Date: | Re: Priority of Statments / Connections, Dave Cramer |
| Previous by Thread: | Re: ANY subquery and PreparedStatements, David Wall |
| Next by Thread: | Re: ANY subquery and PreparedStatements, Csaba Nagy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home | sitemap
| advertise | OSDir is
an inevitable website.
|