Win a copy of Design for the Mind this week in the Design forum!
    Bookmark Topic Watch Topic
  • New Topic

Any Replacement of ArrayDescriptor?

 
xing wogong
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
[ March 08, 2005: Message edited by: Bear Bibeault ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34179
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Xing,
Please don't post the same question multiple times.
 
    Bookmark Topic Watch Topic
  • New Topic