You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kris Schneider <kr...@dotech.com> on 2004/06/24 18:17:54 UTC

Re: [OT] Arraylists/Collections

If by "proper", you mean "a standard approach that works for all JDBC-compliant
drivers", I'm guessing you're out of luck. It will depend on your specific
combination of driver and database. For example, to use an array as an IN param
with Oracle I believe you have to use their ArrayDescriptor and ARRAY classes.
You also have to be able to treat your statement instance as an
OraclePreparedStatement. Who knows, maybe there's a driver out there that can
handle:

stmt.setObject(i, theJavaArray, Types.ARRAY);

The problem with PreparedStatement.setArray is getting an instance of
java.sql.Array that represents the array you want to use as input. Although, I
haven't necessarily spent a lot of time investigating this sort of thing so I
could be way off base.

Quoting "CRANFORD, CHRIS" <ch...@setechusa.com>:

> Is there a proper way to pass an arraylist/collection to a pl/sql procedure
> besides turning it into a string on the java-side and passing it then as a
> VARCHAR parameter?
> 
> _______________________________________________________
> Chris Cranford
> Programmer/Developer
> SETECH Inc. & Companies
> 6302 Fairview Rd, Suite 201
> Charlotte, NC  28210
> Phone: (704) 362-9423, Fax: (704) 362-9409, Mobile: (704) 650-1042 
> Email: chris.cranford@setechusa.com

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org