I noticed this bug in the DatabaseTableDataSource.mapObject method while
trying to use the PostgreSQL driver with Persevere.
When setting the id parameter in PreparedStatement try to use setInt on
numeric values as some JDBC drivers are picky. Fall back to setString when
if an int cannot be parsed.
I've attached a patch that solves this using the following way:
try { loadStatement.setInt(1, Integer.parseInt(objectId));
} catch (NumberFormatException e) {
loadStatement.setString(1, objectId);
}
Original issue reported on code.google.com by schisamo on 25 Feb 2009 at 5:15
Original issue reported on code.google.com by
schisamo
on 25 Feb 2009 at 5:15Attachments: