Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java_server thread: JDBC Problem


Message #1 by "Danny Ayers" <danny_ayers@y...> on Wed, 9 Aug 2000 11:3:40
Can anyone help with this?

Please reply to : wbhsu@p...

I was reading one of your book, "Professional Java Server Programming", 
and
tried to practice with some codes using JDBC.  I run into a problem 
while
calling a stored PL/SQL procedure using CallableStatement.  This 
procedure
has an OUT parameter which is a composite data type, i.e., an indexed 
table.
I would like to know how to register this parameter, i.e. which 
Types.XXX I
should choose.  The details are as below:

procedure proc
( in_para    IN       VARCHAR2,
  out_para   OUT      indexed_table,
)

where index_table is an indexed table of VARCHAR2.

try{
    CallableStatement cs=con.prepareCall("{call proc(?,?)}");

    cs.setString(1,"anystring");

    cs.registerOutParameter(2,Types.XXX);//How to set the Types here?

    cs.execute();

    xxx=cs.getXXX(2);  //which method to use?

    cs.close();
    }
catch(SQLException e){
    System.out.println("Error accessing to the database!");
    System.out.println(e.toString());
    }

I should appreciate it if you can give me any instruction.


Thanks.


Weibiao

  Return to Index