Import java. SQL. callablestatement;
Import java. SQL. connection;
Import java. SQL. drivermanager;
Import java. SQL. resultset;
Import java. SQL. sqlexception;
Import java. util. arraylist;
Import java. util. List;
Import oracle. JDBC. oracletypes;
Import oracle. JDBC. rowset. oraclecachedrowset;
Import oracle. SQL. array;
Import oracle. SQL. arraydescriptor;
Import oracle. SQL. characterset;
Public class temp {
/**
* @ Param ARGs
*/
Public static void main (string [] ARGs) throws exception {
Class. forname ("oracle. JDBC. Driver. oracledriver ");
Connection conn = drivermanager. getconnection ("JDBC: oracle: thin: @ XXXXXXXX: 1521: billbj1", "XXXX", "XXXX ");
Callablestatement = conn. preparecall ("{? = Call xxxxxxxxxxxxx (?,?,?,?)} ");
Callablestatement. registeroutparameter (1, oracletypes. cursor );
Characterset dbcharset = characterset. Make (characterset. al32utf8_charset); // you can specify the character set for debugging.
List <oracle. SQL. Char> cid = new arraylist <oracle. SQL. Char> ();
Oracle. SQL. Char value = new Oracle. SQL. Char ("6487", dbcharset );
CID. Add (value );
List <oracle. SQL. Char> nid = new arraylist <oracle. SQL. Char> ();
Value = new Oracle. SQL. Char ("0105591", dbcharset );
Nid. Add (value );
Array channelidarray = createarray ("channelidarray", CID, Conn );
Callablestatement. setarray (2, channelidarray );
Callablestatement. setstring (3, "200810010000 ");
Callablestatement. setstring (4, "200810010059 ");
Array nodeidarray = createarray ("nodeidarray", NID, Conn );
Callablestatement. setarray (5, nodeidarray );
Callablestatement.exe cute ();
resultset RS1 = (resultset) callablestatement. getObject (1);
oraclecachedrowset rs = new oraclecachedrowset ();
Rs. populate (RS1);
rs1.close ();
callablestatement. close ();
Conn. close ();
int x = 0;
while (RS. next () & ++ x <10) {
JAVA. SQL. timestamp d = Rs. gettimestamp (1);
system. out. println (D. tostring ();
}< BR >}< br> Private Static array createarray (final string sqltypename,
final list channelids, connection)
throws sqlexception {
arraydescriptor channelidarraydesc = arraydescriptor. createdescriptor (
sqltypename, connection);
array channelidarray = new array (channelidarraydesc, connection, channelids. toarray (New Oracle. SQL. char [0]);
return channelidarray;
}< BR >}