* Fixed issue where CachedRowSetImpl throws null pointer exception when getInt() is call for a decimal/double column

This commit is contained in:
Heng Sin Low 2007-01-09 14:13:13 +00:00
parent b157d7c608
commit a27463844d
1 changed files with 26 additions and 0 deletions

View File

@ -213,4 +213,30 @@ public class CCachedRowSet extends CachedRowSetImpl implements CachedRowSet
{
return super.toCollection (column);
}
@Override
public int getInt(int idx) throws SQLException {
//CachedRowSetImpl throw null pointer exception converting
//decimal value to integer
try {
return super.getInt(idx);
} catch (NullPointerException e) {
String s = getString(idx);
if ( s == null ) return 0;
return Double.valueOf(s).intValue();
}
}
@Override
public int getInt(String column) throws SQLException {
//CachedRowSetImpl throw null pointer exception converting
//decimal value to integer
try {
return super.getInt(column);
} catch (NullPointerException e) {
String s = getString(column);
if ( s == null ) return 0;
return Double.valueOf(s).intValue();
}
}
} // CCachedRowSet