Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SELECT * FROM TESTTABLE WHERE ID IN (?)

 
Geoffrey Graff
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a query (SELECT * FROM TESTTABLE WHERE ID IN (?)) and I want to pass in parameter a list of values (an array or something like that) to put in my condition IN.
How can I do in java ? Is there something special in the PreparedStatement ? Or have I to use another statement or another type of query ?
Thanks
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have an array object hold your variables. You can then use the prepared statement's setObject method to set it to the name of the array.
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ June 11, 2002: Message edited by: CL Gilbert ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic