SQLJ & SQL TABLE OF TYPES.

From: Mark Smith <mark_at_maho-mark.fsnet.co.uk>
Date: Tue, 18 Dec 2001 14:54:24 -0000
Message-ID: <9vnl9i$j2k$1_at_newsg2.svr.pol.co.uk>



Hello

I'm newish to Java and new to SQLJ.

We have a suite of packages and procs which have return types that are table of objects..

This format worked well with OO4O and j++ we are now converting to proper java and are having
difficulty in mapping these datatypes to SQLJ datatypes.

eg.
Create or replace TYPE pobj_internet AS OBJECT ( col1 Varchar2(100) , col2 Varchar2(100), col3 Varchar2(100), col4 Varchar2(100) );

create or replace type ptab_internet as TABLE of pobj_internet

my package spec is

create or replace package db_test_internet as

  package select_list (p_tab OUT ptab_internet );

end;

Basically it returns a table of objects that are populated with data.

We have generated the Java using the JPublisher wizard to generate the required java wrappers but at run time
we are getting a NULLPointerException Exception at runtime.

Here is a snippet of code that is generating the error

   try {

         proccall = new dbTestInternet();
         PtabInternet[]  myData=null;

         System.out.println("before call");
         proccall.selectListx( pTab);

}
catch (Exception e) { System.out.println("SQLJ ERROR " + e.toString());
}

  }

I've tried various ways of solving this but my java/SQLJ knowledge is a little basic.

I hope someone can help.

Cheers

Mark Received on Tue Dec 18 2001 - 15:54:24 CET

Original text of this message