da una classe Java chiamo una procedura oracle che dovrebbe restituire un array di String.
La procedura sembra funzionare bene e il log oracle dice che le stringhe ci sono.
In java faccio quanto segue....
String elements[] = new String[1];
ArrayDescriptor desc = (ArrayDescriptor)ArrayDescriptor.createDescriptor( "ERRARRAYS", con);
System.out.println("passato arrayDescriptor");
ARRAY arr = new ARRAY(desc, con, elements);
String sql = "{call PK_VALIDA_DATI_PF.main(?,?,?,?,?,?,?,?,?)}";
cstm = con.prepareCall(sql);
SimpleTrace.trace("SQL: " + sql);
cstm.setArray(8, arr);
cstm.registerOutParameter(8, OracleTypes.ARRAY, "ERRARRAYS"); cstm.registerOutParameter(9, Types.VARCHAR); //descrizione err
cstm.setString(1, cognome);
cstm.setString(2, nome);
cstm.setString(3, sesso);
cstm.setTimestamp(4, dataNascita);
cstm.setString(5, provinciaNascita);
cstm.setString(6, comuneNascita);
cstm.setString(7, codiceFiscale);
SimpleTrace.trace("cstm.getString(9): " + cstm.getString(9));
arr = ( (OracleCallableStatement) cstm).getARRAY(8);
System.out.println("Vediamo che c'è nell'array" + arr);
System.out.println("la lunghezza dell'array è:" + arr.length());
String [] valori = (String[]) arr.getArray();
for (int i = 0; i < valori.length; i++) {
String valore = (String) valori[i];
SimpleTrace.trace(i + ": [" + valore + "]");
}
Questo ultima istruzione mi stampa ??? tre punti interrogativi, mentre dal log della procedura so che l'array dovrebbe contenere una stringa tipo "errore.validazione.nome" o roba del genere...
qualche idea????
grazie!!