Affects Version/s: 1.1
Fix Version/s: None
There is currently many open issues (
DBUTILS-14, DBUTILS-31, DBUTILS-39 and DBUTILS-41) concerning the problem with setNull(i+1, Types.VARCHAR) in the QueryRunner#fillStatement method when the given object is null.
I use Commons DbUtils in several projects, and I have found a workaround which works for any database:
The problem is that when the object is null, the API does not know to which SQL TYPE it should map the object to.
I've added an Interface, named SQLParam, which exactely resolve this problem:
Then I've changed the QueryRunner API, by replacing all Object param and Object params by SQLParam param and SQLParam params (in a new QueryRunnerSQLParam class).
It does work just well for me; any comments gladly appreciated.