This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Any Replacement of ArrayDescriptor? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Reply locked New topic

Any Replacement of ArrayDescriptor?

xing wogong

Joined: Jul 25, 2002
Posts: 10
Hi, I am using stored procedure which received the java array I passed like this:

public class ArrayDemo

public static void passArray() throws SQLException
Connection conn =
new OracleDriver().defaultConnection();

int intArray[] = { 1,2,3,4,5,6 };

ArrayDescriptor descriptor =
ArrayDescriptor.createDescriptor( "NUM_ARRAY", conn );

ARRAY array_to_pass =
new ARRAY( descriptor, conn, intArray );
OraclePreparedStatement ps =
( "begin give_me_an_array(:x); end;" );
ps.setARRAY( 1, array_to_pass );
Somehow, my company does not allow us to use any oracle extension on JDBC, and we only can use API that used in standard JDBC. But in standard JDBC, I can not find a equivalent object as oracle's ArrayDescriptor, and there is not constructor for java.sql.Array, thus I do not know how to construct an Array object in Java side.

What should I do then? Is it impossible for me to avoid oracle's extention?

[ March 08, 2005: Message edited by: Bear Bibeault ]
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33133

Please don't post the same question multiple times.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Any Replacement of ArrayDescriptor?
It's not a secret anymore!