Abbreviation | Meaning |
---|---|
I | Iterator |
L | List |
M | Map |
O | Object |
RS | ResultSet |
S | String |
T | generic class, which can be a primitive Java type or a bean |
getXxx() methods | RS | O[] | L<M<S,O>> | L<T> | M<S,O>[] | <T> | <T>[] | I<M<S,O>> | I<T> |
---|---|---|---|---|---|---|---|---|---|
getOutputParms() | X | ||||||||
getArray() | X | ||||||||
getArray() with returnClass | X | ||||||||
getArray() with RowHandler | X | ||||||||
getList() | X | ||||||||
getList() with returnClass | X | ||||||||
getList() with RowHandler | X | ||||||||
getIterator() | X | ||||||||
getIterator() with returnClass | X | ||||||||
getIterator() with RowHandler | X | ||||||||
getResults() | X | ||||||||
getQuery() with ResultHandler | X |
When you use a method of the StoredProcedureResult interface, do not specify a generic <T> class that is any of the <primitive Java type>.class classes, such as int.class.
Information regarding SQL null values is lost whenever information queried from SQL is stored in a primitive Java type. Also, Java requires that a generic method that specifies generic <T> class of a <primitive Java type>.class must return an instance of the wrapper class that is appropriate for that primitive Java type.
int tCount = storedProcedureResult.queryArray(int.class);
because
the definition of the queryArray() method is this:<T> T[] storedProcedureResult.queryArray(Class<T> returnClass);
Integer[] tCount = storedProcedureResult.queryArray(Integer.class);