Jorge>The value of 0 should be used to fetch all rows, if we leave the default at 0 and handle internally that as 100 (and reporting it as 0) it is a wrong behavior.
Note that "unset" and "set to 0" might have different meanings for a good (or bad?) reason.
Yes, but "by default" is set to 0, not "unset (null)":
/** * Default parameter for {@link java.sql.Statement#getFetchSize()}. A value of {@code 0} means * that need fetch all rows at once */ DEFAULT_ROW_FETCH_SIZE("defaultRowFetchSize", "0", "Positive number of rows that should be fetched from the database when more rows are needed for ResultSet by each fetch iteration"),
So if the driver internally handle fetch size 0 == fetch size 100, that's what i call an hidden inconsistent behavior.
Don't get me wrong, it make sense to switch defaultRowFetchSize to "100", but a call to getFetchSize() should be == 100, not 0.
As I said 99% of the code out there will never use this as fetch size is totally useless in autocommit mode. Also an inconsistent behaviour. There a lots of them.. Setting it internally is fine IMO. I also think it should be reported as 0 unless the user explicitly sets it. What we do inside the driver is our business.