I've com across this and I haven't been able to find the proper documentation.
Basically I have in a MySQL table a column that is used to hold a year value the type of the column is SMALLINT the column can be null, and whenever I retrieve the value (NULL) using the method resultset.getShort("year"); I get a 0 instead of the expected null value.
The year value is a member of a bean that means that I use accessor methods, so when I use a CallableStatement object and I set the placeholders accordingly I get a NullPointerException I know this should be expected but there are cases when I need to explicitly set the value to null such as when the year is not supplied or the user enters letters or a string that is not a "year"
Is this the default behavior as the other wrapper classes for primitives do allow null values.
What is the right type mapping to a SMALLINT or should I change the column to INT?