I am performing an insert on a dbaseIV dbf table (SORMAS.DBF) and I keep getting the following exception thrown at the point of the ps.executeUpdate(). Code snipit is below... Any ideas ???
Elapsed Time (2595615 ms): [ERROR] ExchangeManagerBean.java - java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException: 891507
private void insertOnSORMASTable(ExchangeOrderDataObj edo)
{
PreparedStatement ps = null;
Connection dbfConn = null;
try {
dbfConn = DriverManager.getConnection(Constant.DBF_PROVIDER_URL);
ps = dbfConn.prepareStatement("insert into SORMAS (ACCT_NUM, UNITNO, INVMODELNO, MINVPONO, MINVRONO, VIN) values (?, ?, ?, ?, ?, ?)");
ps.setString(1, edo.getDealerCode());
ps.setBigDecimal(2, new BigDecimal(edo.getRANumber()));
ps.setString(3, edo.getPartNumber());
ps.setString(4, edo.getPONumber());
ps.setString(5, edo.getRONumber());
ps.setString(6, edo.getVIN());
if (ps.executeUpdate() != 1)
{
throw new SQLException("Insert failed on SORMAS table");
}
}
......
}
|
The dbf file has an associated MDX file which when I delete from the directory seems to work fine. Does your product support MDX files ?
|
HXTT DBF supports MDX files. You can try "REINDEX ALL ON SORMAS" to rebuild your corrupted MDX files if you hasn't deleteD that SORMAS.MDX file, or restore your SORMAS.MDX file from other place. Then try your code, and that ArrayIndexOutOfBoundsException should disappear. If your error exists still, just let us know.
|