RE: [OT] Arraylists/Collections

2004-06-24 Thread Gaurav_Goyal
A possible way to do this could be to insert the collection into a temp
table in the database and access that using the PL/SQL proc to do your
processing. 

-Original Message-
From: Bill Siggelkow [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 24, 2004 11:14 AM
To: [EMAIL PROTECTED]
Subject: Re: Arraylists/Collections


java.sql.Array?

CRANFORD, CHRIS wrote:

> 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: [EMAIL PROTECTED]
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Arraylists/Collections

2004-06-24 Thread Kris Schneider
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" <[EMAIL PROTECTED]>:

> 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: [EMAIL PROTECTED]

-- 
Kris Schneider 
D.O.Tech   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]