You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eva Garabedian <ev...@indelible.tv> on 2002/06/13 00:10:12 UTC

ArrayDescriptor - GenericConnection exception

Hello List - I've got a question about passing a string array into an
Oracle Procedure. 
Specifically, my ArrayDescriptor assignment line is throwing a struts
exception, whose message is simply
"org.apache.struts.util.GenericConnection".
I'm using a CallableStatement in my Java code to pass my String[] to my
Oracle procedure. Before I added the String[] parameter, everything was
working quite nicely. Now when I run this I get the dreaded
NullPointerException in the Tomcat messages in my browser, and the first
"System.out.println" (found below) shows up, but the GenericConnection
exception is thrown before the second println executes. This leads me to
believe that the ArrayDescriptor is the culprit. In the following code,
please note that the user_type NL_GROUP exists in my database, created
by the user CREATOR.

Thanks in advance for any suggestions about where I should look for
help. 



Here is my related code: 
    public boolean addCustomer(String userName, String password,
String[] nlGroup) throws Exception  {
 
       Connection conn = null;
       CallableStatement stmt = null;
       String sql = "{call INS_CUSTOMER_AND_CONTACT_INFO(?, ?, ?)}";
 
   try {
     conn = dataSource.getConnection();
 
     System.out.println("After getConnection. ");
 
     ArrayDescriptor desc =
ArrayDescriptor.createDescriptor("CREATOR.NL_GROUP", conn);
 
     System.out.println("After arrayDescriptor assignment. ");
 
     ARRAY newArray = new ARRAY(desc, conn, nlGroup);
     stmt = conn.prepareCall(sql);
     stmt.setString(1, userName);
     stmt.setString(2, password);
     ((OraclePreparedStatement)stmt).setArray(3, newArray);
.
.
.