Hi,
I am using jdk1.3 and PROGRESS 09.1B database. My driver is
progress.sql.jdbc.JdbcProgressDriver.(1.1000 (03.60.0000))
There is an array field (extents 4) in my table. I have to update it. I tried
using setArray in the preparedstatement for updation.
But i dont know what param to use for
setArray(int i, Array x) .
I have, Double elements[] = ; which has to be updated into
the array field. I found ArrayDescriptor and ARRAY used for that in Oracle.
But couldnt find correspoding datatypes/methods in Progress. Could any one
please help me....
My method for updating is shown below:
/*********************************************/
public boolean updateAccountArray(int domain)
throws DataSourceException
{
Connection con = null;
Double elements[] = ;
ArrayDescriptor desc =
ArrayDescriptor.createDescriptor("NUM_ARRAY",con);
ARRAY newArray = new ARRAY(desc,con,elements);
PreparedStatement pstatement = null;
boolean bExecute = false ;
StringBuffer sql = null;
boolean bExist = false;
try {
con =
JdbcUtil.getConnection(JdbcConstants.X);
sql = new StringBuffer
("UPDATE accttable SET
accounttable.accountnumber = ? where");
sql.append("accounttable.domain = " +
domain + ");
pstatement = con.prepareStatement
(sql.toString());
pstatement.setArray(0,newArray);
bExecute =
pstatement.execute(sql.toString());
System.out.println("returned value ..." +
bExecute);
return bExecute;
} catch (SQLException ex) {
throw ex;
} finally {
JdbcUtil.close(pstatement, con);
}
}
/************************************************/
Thanks,
Swathi