Return types for getXxx() methods in the StoredProcedureResult interface

This table shows the return types for each queryXxx() method in the StoredProcedureResult interface.
Table 1. Key to the table of return types
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
Table 2. Return types for each queryXxx() method in the StoredProcedureResult interface
   
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      

Restriction for returning <T> objects

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.

For example, Java does not allow method invocations such as this:
int tCount = storedProcedureResult.queryArray(int.class);
because the definition of the queryArray() method is this:
<T> T[] storedProcedureResult.queryArray(Class<T> returnClass);
The declared class of tCount must be Integer[].
Integer[] tCount = storedProcedureResult.queryArray(Integer.class);

Feedback