Re: Need java.sql.Array impl for PreparedStatement.setArray()
Posted by: tauron
Date: July 22, 2005 07:39AM

What is the recommended way to implement queries like
SELECT id FROM table WHERE x IN (1,2,3)
using a PreparedStatement in the current Connector/J 3.1.10?

PreparedStatement pStmt = connection.prepareStatement("SELECT id FROM table WHERE x IN ?");
int[] array = {1,2,3};
pStmt.setString(1, array); // <- won't work
ResultSet rs = pStmt.executeQuery();

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.