wood burning stoves 2.0*
The moose likes Oracle/OAS and the fly likes any replacement for ArrayDescriptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "any replacement for ArrayDescriptor " Watch "any replacement for ArrayDescriptor " New topic
Author

any replacement for ArrayDescriptor

xing wogong
Greenhorn

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 =
(OraclePreparedStatement)conn.prepareStatement
( "begin give_me_an_array(:x); end;" );
ps.setARRAY( 1, array_to_pass );
ps.execute();
}
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?

Thanks
Wogong
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121

Wogong,
As far as I know, you must use Oracle-specific classes to achieve this.
The only thing I can suggest, is perhaps try a non-Oracle JDBC driver.
Pardon me but I am not familiar with any, myself, so I cannot help you there.

Good Luck,
Avi.
 
Consider Paul's rocket mass heater.
 
subject: any replacement for ArrayDescriptor
 
Similar Threads
getting underlying oracle connection from Poolable connection
Any Replacement of ArrayDescriptor?
Any replacement for ArrayDescriptor?
Passing multiple values to a stored procedure
Passing array input in procedure - thin driver