 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Timo Nentwig Guest
|
Posted: Mon Feb 02, 2004 1:56 pm Post subject: PreparedStatement: variable amount of placeholders |
|
|
Hi!
SELECT * FROM foo WHERE bar IN (?)
"?" shall be replaced by a variable count of arguments which I don't know at
compile-time. Is this what PreparedStatement.setArray() is good for? Seems
that there are no wrapper classes that implement Array...
TIA
Timo
|
|
| Back to top |
|
 |
Lee Fesperman Guest
|
Posted: Tue Feb 03, 2004 2:00 am Post subject: Re: PreparedStatement: variable amount of placeholders |
|
|
Timo Nentwig wrote:
| Quote: |
Hi!
SELECT * FROM foo WHERE bar IN (?)
"?" shall be replaced by a variable count of arguments which I don't know at
compile-time. Is this what PreparedStatement.setArray() is good for? Seems
that there are no wrapper classes that implement Array...
|
That is not supported by JDBC. ? parameters only accept scalar values.
The only solution is to build the SQL command with the needed number of ?'s (or just
literals).
--
Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|